Java Code Examples for com.google.common.base.Objects

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project ambrose, under directory /common/src/main/java/azkaban/common/utils/.

Source file: Props.java

  20 
vote

@Override public boolean equals(Object o){
  if (o == this)   return true;
 else   if (o == null)   return false;
 else   if (o.getClass() != Props.class)   return false;
  Props p=(Props)o;
  return _current.equals(p._current) && Objects.equal(this._parent,p._parent);
}
 

Example 2

From project android_external_guava, under directory /src/com/google/common/collect/.

Source file: AbstractBiMap.java

  19 
vote

private V putInBothMaps(@Nullable K key,@Nullable V value,boolean force){
  boolean containedKey=containsKey(key);
  if (containedKey && Objects.equal(value,get(key))) {
    return value;
  }
  if (force) {
    inverse().remove(value);
  }
 else {
    checkArgument(!containsValue(value),"value already present: %s",value);
  }
  V oldValue=delegate.put(key,value);
  updateInverseMap(key,containedKey,oldValue,value);
  return oldValue;
}
 

Example 3

From project azkaban, under directory /azkaban-common/src/java/azkaban/common/utils/.

Source file: Props.java

  19 
vote

@Override public boolean equals(Object o){
  if (o == this)   return true;
 else   if (o == null)   return false;
 else   if (o.getClass() != Props.class)   return false;
  Props p=(Props)o;
  return _current.equals(p._current) && Objects.equal(this._parent,p._parent);
}
 

Example 4

From project b1-pack, under directory /cli/src/main/java/org/b1/pack/cli/.

Source file: Main.java

  19 
vote

private static void printError(Exception e){
  System.err.println();
  System.err.print("Error: ");
  System.err.println(Objects.firstNonNull(e.getMessage(),e.getClass().getSimpleName()));
  System.err.println();
  System.err.println("For help type: b1 -h");
}
 

Example 5

From project bonecp, under directory /bonecp/src/main/java/com/jolbox/bonecp/.

Source file: BoneCPConfig.java

  19 
vote

/** 
 * Returns true if this instance has the same config as a given config.
 * @param that
 * @return true if the instance has the same config, false otherwise.
 */
public boolean hasSameConfiguration(BoneCPConfig that){
  if (that != null && Objects.equal(this.acquireIncrement,that.getAcquireIncrement()) && Objects.equal(this.acquireRetryDelayInMs,that.getAcquireRetryDelayInMs()) && Objects.equal(this.closeConnectionWatch,that.isCloseConnectionWatch()) && Objects.equal(this.logStatementsEnabled,that.isLogStatementsEnabled()) && Objects.equal(this.connectionHook,that.getConnectionHook()) && Objects.equal(this.connectionTestStatement,that.getConnectionTestStatement()) && Objects.equal(this.idleConnectionTestPeriodInSeconds,that.getIdleConnectionTestPeriod(TimeUnit.SECONDS)) && Objects.equal(this.idleMaxAgeInSeconds,that.getIdleMaxAge(TimeUnit.SECONDS)) && Objects.equal(this.initSQL,that.getInitSQL()) && Objects.equal(this.jdbcUrl,that.getJdbcUrl()) && Objects.equal(this.maxConnectionsPerPartition,that.getMaxConnectionsPerPartition()) && Objects.equal(this.minConnectionsPerPartition,that.getMinConnectionsPerPartition()) && Objects.equal(this.partitionCount,that.getPartitionCount()) && Objects.equal(this.releaseHelperThreads,that.getReleaseHelperThreads()) && Objects.equal(this.statementsCacheSize,that.getStatementsCacheSize()) && Objects.equal(this.username,that.getUsername()) && Objects.equal(this.password,that.getPassword()) && Objects.equal(this.lazyInit,that.isLazyInit()) && Objects.equal(this.transactionRecoveryEnabled,that.isTransactionRecoveryEnabled()) && Objects.equal(this.acquireRetryAttempts,that.getAcquireRetryAttempts()) && Objects.equal(this.statementReleaseHelperThreads,that.getStatementReleaseHelperThreads()) && Objects.equal(this.closeConnectionWatchTimeoutInMs,that.getCloseConnectionWatchTimeout()) && Objects.equal(this.connectionTimeoutInMs,that.getConnectionTimeoutInMs()) && Objects.equal(this.datasourceBean,that.getDatasourceBean()) && Objects.equal(this.getQueryExecuteTimeLimitInMs(),that.getQueryExecuteTimeLimitInMs()) && Objects.equal(this.poolAvailabilityThreshold,that.getPoolAvailabilityThreshold()) && Objects.equal(this.poolName,that.getPoolName()) && Objects.equal(this.disableConnectionTracking,that.isDisableConnectionTracking())) {
    return true;
  }
  return false;
}
 

Example 6

From project CIShell, under directory /core/org.cishell.reference/src/org/cishell/reference/app/service/scheduler/.

Source file: SchedulerServiceImpl.java

  19 
vote

@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof AlgorithmState)) {
    return false;
  }
  AlgorithmState other=(AlgorithmState)obj;
  return Objects.equal(this.name,other.name);
}
 

Example 7

From project closure-templates, under directory /java/src/com/google/template/soy/internal/base/.

Source file: Pair.java

  19 
vote

@Override public boolean equals(@Nullable Object object){
  if (object instanceof Pair<?,?>) {
    Pair<?,?> that=(Pair<?,?>)object;
    return Objects.equal(this.first,that.first) && Objects.equal(this.second,that.second);
  }
  return false;
}
 

Example 8

From project clustermeister, under directory /api/src/main/java/com/github/nethad/clustermeister/api/.

Source file: Credentials.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  if (obj == this) {
    return true;
  }
  if (obj.getClass() != (getClass())) {
    return false;
  }
  Credentials otherCreds=(Credentials)obj;
  return Objects.equal(name,otherCreds.name) && Objects.equal(user,otherCreds.user);
}
 

Example 9

From project cogroo4, under directory /cogroo-ann/src/main/java/org/cogroo/text/impl/.

Source file: SentenceImpl.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj instanceof SentenceImpl) {
    SentenceImpl that=(SentenceImpl)obj;
    return Objects.equal(this.tokens,that.tokens) && Objects.equal(this.span,that.span);
  }
  return false;
}
 

Example 10

From project commons-j, under directory /src/main/java/nerds/antelax/commons/net/pubsub/.

Source file: Message.java

  19 
vote

@Override public String toString(){
  final ToStringHelper tsh=Objects.toStringHelper(getClass());
  tsh.add("type",type.name());
  tsh.add("ttl",ttl);
  tsh.add("source UUID",sourceID);
  tsh.add("server UUID",serverID);
  tsh.add("body length",estimatedBodySize());
  return tsh.toString();
}
 

Example 11

From project components-ness-config, under directory /src/main/java/com/nesscomputing/config/.

Source file: Config.java

  19 
vote

public <T>T getBean(final String prefix,final Class<T> classType,final Map<String,String> replacements){
  ConfigurationObjectFactory factory=null;
  Object key=Objects.firstNonNull(prefix,NULL_OBJECT);
  factory=objectFactories.get(key);
  if (factory == null) {
    Configuration cfg=prefix == null ? config : config.subset(prefix);
    factory=new ConfigurationObjectFactory(new CommonsConfigSource(cfg));
    ConfigurationObjectFactory newFactory=objectFactories.putIfAbsent(key,factory);
    factory=Objects.firstNonNull(newFactory,factory);
  }
  return factory.buildWithReplacements(classType,replacements);
}
 

Example 12

From project components-ness-httpclient, under directory /client/src/main/java/com/nesscomputing/httpclient/response/.

Source file: NumberContentConverter.java

  19 
vote

@Override public T convert(HttpClientResponse httpClientResponse,InputStream inputStream) throws IOException {
  final int responseCode=httpClientResponse.getStatusCode();
switch (responseCode) {
case 200:
case 201:
    final Charset charset=Charset.forName(Objects.firstNonNull(httpClientResponse.getCharset(),"UTF-8"));
  final InputStreamReader reader=new InputStreamReader(inputStream,charset);
try {
  final String data=CharStreams.toString(reader);
  final T result=numberClass.cast(safeInvoke(data));
  if (result == null) {
    if (responseCode == 201) {
      return emptyValue;
    }
    throw new IllegalArgumentException(format("Could not parse result '%s'",data));
  }
  return result;
}
  finally {
  Closeables.closeQuietly(reader);
}
case 204:
return emptyValue;
case 404:
if (ignore404) {
return emptyValue;
}
default :
LOG.warn("Remote service responded to \"%s\" with code %d (cause: %s)",httpClientResponse.getUri(),responseCode,httpClientResponse.getStatusText());
throw new HttpResponseException(httpClientResponse);
}
}
 

Example 13

From project components-ness-jersey, under directory /jersey/src/main/java/com/nesscomputing/jersey/exceptions/.

Source file: GuiceProvisionExceptionMapper.java

  19 
vote

@Override public Response toResponse(final ProvisionException exception){
  final Collection<Message> messages=exception.getErrorMessages();
  Throwable cause=null;
  if (CollectionUtils.isNotEmpty(messages)) {
    for (    Message message : messages) {
      cause=message.getCause();
      if (cause != null) {
        break;
      }
    }
  }
  if (cause != null) {
    LOG.trace("Mapping %s",cause.getClass().getSimpleName());
    final ExceptionMapper<Throwable> mapper=find(cause.getClass());
    if (mapper != null) {
      return mapper.toResponse(cause);
    }
  }
  LOG.error(exception,"Did not find a mapper to handle exception type %s wrapped in ProvisionException",cause != null ? cause.getClass() : "<null>");
  final Map<String,String> response=ImmutableMap.of("code",Status.INTERNAL_SERVER_ERROR.toString(),"trace",ObjectUtils.toString(MDC.get("track")),"message",((cause != null) ? Objects.firstNonNull(cause.getMessage(),"unknown") : "unknown"));
  return Response.status(Status.INTERNAL_SERVER_ERROR).entity(response).type(MediaType.APPLICATION_JSON_TYPE).build();
}
 

Example 14

From project cp-common-utils, under directory /src/com/clarkparsia/common/base/.

Source file: Options.java

  19 
vote

/** 
 * @inheritDoc
 */
@Override public boolean equals(final Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Options aOptions=(Options)o;
  return Objects.equal(options,aOptions.options);
}
 

Example 15

From project cp-openrdf-utils, under directory /core/src/com/clarkparsia/openrdf/.

Source file: ContextAwareStatement.java

  19 
vote

/** 
 * @inheritDoc
 */
@Override public boolean equals(final Object theObj){
  if (this == theObj) {
    return true;
  }
  if (theObj == null || !(theObj instanceof Statement)) {
    return false;
  }
  final Statement that=(Statement)theObj;
  return mObject.equals(that.getObject()) && mSubject.equals(that.getSubject()) && mPredicate.equals(that.getPredicate())&& Objects.equal(mContext,that.getContext());
}
 

Example 16

From project daleq, under directory /daleq-core/src/main/java/de/brands4friends/daleq/core/internal/builder/.

Source file: FieldHolder.java

  19 
vote

@Override public final boolean equals(final Object obj){
  if (obj instanceof FieldHolder) {
    final FieldHolder that=(FieldHolder)obj;
    return Objects.equal(fieldTypeRef,that.fieldTypeRef) && Objects.equal(value,that.value);
  }
  return false;
}
 

Example 17

From project droid-fu, under directory /src/main/java/com/google/common/collect/.

Source file: AbstractMapEntry.java

  19 
vote

@Override public boolean equals(Object object){
  if (object instanceof Entry) {
    Entry<?,?> that=(Entry<?,?>)object;
    return Objects.equal(this.getKey(),that.getKey()) && Objects.equal(this.getValue(),that.getValue());
  }
  return false;
}
 

Example 18

From project eclipse-task-editor, under directory /plugins/de.sebastianbenz.task/xtend-gen/de/sebastianbenz/task/generator/.

Source file: ConfluenceGenerator.java

  19 
vote

protected CharSequence _write(final Link link){
  String url=link.getUrl();
  boolean _startsWith=url.startsWith("http://");
  boolean _not=(!_startsWith);
  if (_not) {
    String _plus=("http://" + url);
    url=_plus;
  }
  String description="";
  String _description=link.getDescription();
  boolean _equals=Objects.equal(_description,"");
  if (_equals) {
    String _url=link.getUrl();
    description=_url;
  }
 else {
    String _description_1=link.getDescription();
    description=_description_1;
  }
  String _description_2=link.getDescription();
  String _plus_1=("[" + _description_2);
  String _plus_2=(_plus_1 + "|");
  String _url_1=link.getUrl();
  String _plus_3=(_plus_2 + _url_1);
  return (_plus_3 + "]");
}
 

Example 19

From project emite, under directory /src/main/java/com/calclab/emite/core/sasl/.

Source file: Credentials.java

  19 
vote

@Override public final boolean equals(@Nullable final Object obj){
  if (obj instanceof Credentials) {
    final Credentials other=(Credentials)obj;
    return Objects.equal(uri,other.uri) && Objects.equal(password,other.password);
  }
  return false;
}
 

Example 20

From project Empire, under directory /core/src/com/clarkparsia/empire/annotation/.

Source file: SupportsRdfIdImpl.java

  19 
vote

/** 
 * @inheritDoc
 */
@Override public boolean equals(final Object theObj){
  if (this == theObj) {
    return true;
  }
  if (theObj == null || getClass() != theObj.getClass()) {
    return false;
  }
  final SupportsRdfIdImpl that=(SupportsRdfIdImpl)theObj;
  return Objects.equal(mId,that.mId);
}
 

Example 21

From project ExperienceMod, under directory /ExperienceMod/src/com/comphenix/xp/.

Source file: ExperienceMod.java

  19 
vote

/** 
 * Retrieves a list of action rewards that applies when a player performs a given action to the item or block specified by the query. <p> The query must be a ItemQuery for every trigger except brewing, where it also can be a PotionQuery. <p> Also note that this list contains every possible reward that matches the given parameters. In reality, only the  first item will be awarded.
 * @param player - player performing the given action, or NULL if the default configuration file should be used.
 * @param trigger - action the player performs. 
 * @param query - query representing the item or block that was the target of the action.
 * @return A list of possible rewards. Only the first item will be chosen when rewards are actually awarded.
 * @throws ParsingException If the stored preset option associated with this player is malformed.
 */
public List<Action> getPlayerReward(Player player,Integer trigger,Query query) throws ParsingException {
  Configuration config=getPresets().getConfiguration(player);
  Integer brewing=getActionTypes().getType(ActionTypes.BREWING);
  ItemTree current=config.getActionReward(trigger);
  if (Objects.equal(trigger,brewing) && query instanceof PotionQuery) {
    return config.getComplexBrewingReward().getAllRanked((PotionQuery)query);
  }
 else {
    if (current == null) {
      throw new IllegalArgumentException(String.format("Unknown trigger ID: %s",trigger));
    }
    return current.getAllRanked((ItemQuery)query);
  }
}
 

Example 22

From project FML, under directory /common/cpw/mods/fml/common/asm/transformers/.

Source file: MCPMerger.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj == null || !(obj instanceof MethodWrapper))   return false;
  MethodWrapper mw=(MethodWrapper)obj;
  boolean eq=Objects.equal(node.name,mw.node.name) && Objects.equal(node.desc,mw.node.desc);
  if (eq) {
    mw.client=this.client | mw.client;
    mw.server=this.server | mw.server;
    this.client=this.client | mw.client;
    this.server=this.server | mw.server;
    if (DEBUG) {
      System.out.printf(" eq: %s %s\n",this,mw);
    }
  }
  return eq;
}
 

Example 23

From project generic-store-for-android, under directory /src/com/google/common/collect/.

Source file: AbstractMapEntry.java

  19 
vote

@Override public boolean equals(Object object){
  if (object instanceof Entry) {
    Entry<?,?> that=(Entry<?,?>)object;
    return Objects.equal(this.getKey(),that.getKey()) && Objects.equal(this.getValue(),that.getValue());
  }
  return false;
}
 

Example 24

From project greplin-lucene-utils, under directory /src/main/java/com/greplin/lucene/query/.

Source file: ConstantQueryNormBoostingQuery.java

  19 
vote

@Override public boolean equals(final Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  ConstantQueryNormBoostingQuery that=(ConstantQueryNormBoostingQuery)obj;
  return Float.floatToIntBits(this.boost) == Float.floatToIntBits(that.boost) && Objects.equal(this.context,that.context) && Objects.equal(this.match,that.match);
}
 

Example 25

From project guice-jit-providers, under directory /core/src/com/google/inject/internal/.

Source file: ConstructorBindingImpl.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj instanceof ConstructorBindingImpl) {
    ConstructorBindingImpl<?> o=(ConstructorBindingImpl<?>)obj;
    return getKey().equals(o.getKey()) && getScoping().equals(o.getScoping()) && Objects.equal(constructorInjectionPoint,o.constructorInjectionPoint);
  }
 else {
    return false;
  }
}
 

Example 26

From project gxa, under directory /atlas-model/src/main/java/uk/ac/ebi/microarray/atlas/api/.

Source file: ApiProperty.java

  19 
vote

@Override public boolean equals(Object other){
  if (other != null && other instanceof ApiProperty) {
    return Objects.equal(getName(),((ApiProperty)other).getName()) && Objects.equal(getValue(),((ApiProperty)other).getValue());
  }
  return false;
}
 

Example 27

From project hackergarten-moreunit, under directory /org.moreunit.test.dependencies/src/org/moreunit/test/workspace/.

Source file: JavaType.java

  19 
vote

@Override public boolean equals(Object other){
  if (other == this)   return true;
  if (!(other instanceof JavaType))   return false;
  JavaType o=(JavaType)other;
  return Objects.equal(typeName,o.typeName) && Objects.equal(packageName,o.packageName) && Objects.equal(typeKind,o.typeKind);
}
 

Example 28

From project indextank-engine, under directory /flaptor-util/com/flaptor/util/.

Source file: CollectionsUtil.java

  19 
vote

public static <T>Iterable<T> allButOne(Iterable<T> all,final T one){
  return Iterables.filter(all,new Predicate<T>(){
    public boolean apply(    T t){
      return !Objects.equal(one,t);
    }
  }
);
}
 

Example 29

From project ioke, under directory /src/ikj/main/com/google/common/collect/.

Source file: AbstractMapEntry.java

  19 
vote

/** 
 * Indicates whether an object equals this entry, following the behavior specified in  {@link Entry#equals}.
 */
@Override public boolean equals(Object object){
  if (object instanceof Entry) {
    Entry<?,?> that=(Entry<?,?>)object;
    return Objects.equal(this.getKey(),that.getKey()) && Objects.equal(this.getValue(),that.getValue());
  }
  return false;
}
 

Example 30

From project jclouds-bean-cleaner, under directory /src/main/java/org/jclouds/cleanup/data/.

Source file: Bean.java

  19 
vote

public InstanceField getInstanceField(String name){
  for (  InstanceField field : getInstanceFields()) {
    if (Objects.equal(name,field.getName())) {
      return field;
    }
  }
  return null;
}
 

Example 31

From project jira-rest-java-client, under directory /atlassian-jira-rest-java-client/src/main/java/com/atlassian/jira/rest/client/domain/.

Source file: AddressableNamedEntity.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj instanceof AddressableNamedEntity) {
    AddressableNamedEntity that=(AddressableNamedEntity)obj;
    return Objects.equal(this.self,that.self) && Objects.equal(this.name,that.name);
  }
  return false;
}
 

Example 32

From project junit-quickcheck, under directory /src/test/java/com/pholser/junit/quickcheck/reflect/.

Source file: GenericArrayTypeImpl.java

  19 
vote

@Override public boolean equals(Object that){
  if (this == that)   return true;
  if (!(that instanceof GenericArrayType))   return false;
  GenericArrayType other=(GenericArrayType)that;
  return Objects.equal(getGenericComponentType(),other.getGenericComponentType());
}
 

Example 33

From project kawala, under directory /kawala-common/src/main/java/com/kaching/platform/common/.

Source file: Pair.java

  19 
vote

@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  Pair<?,?> other=(Pair<?,?>)obj;
  return Objects.equal(left,other.left) && Objects.equal(right,other.right);
}
 

Example 34

From project LabelUtils, under directory /src/main/java/org/praat/.

Source file: Collection.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj instanceof Collection) {
    final Collection other=(Collection)obj;
    return Objects.equal(this.items,other.items);
  }
 else {
    return false;
  }
}
 

Example 35

From project logging-java, under directory /logback-amqp-common/src/main/java/eu/arkitech/logback/amqp/accessors/.

Source file: AmqpRawAccessorConfiguration.java

  19 
vote

protected AmqpRawAccessorConfiguration(final AmqpRawAccessorConfiguration override,final AmqpRawAccessorConfiguration overriden){
  super(override,overriden);
  this.host=Objects.firstNonNull(override.host,overriden.host);
  this.port=Objects.firstNonNull(override.port,overriden.port);
  this.virtualHost=Objects.firstNonNull(override.virtualHost,overriden.virtualHost);
  this.username=Objects.firstNonNull(override.username,overriden.username);
  this.password=Objects.firstNonNull(override.password,overriden.password);
}
 

Example 36

From project LUScheduling, under directory /src/org/learningu/scheduling/logic/.

Source file: ScheduleValidator.java

  19 
vote

@Override public String toString(){
  ToStringHelper helper=Objects.toStringHelper(this);
  if (!localStartConflicts.isEmpty()) {
    helper.add("localStartConflicts",localStartConflicts);
  }
  if (!localPresentConflicts.isEmpty()) {
    helper.add("localPresentConflicts",localPresentConflicts);
  }
  if (!globalPresentConflicts.isEmpty()) {
    helper.add("globalPresentConflicts",globalPresentConflicts);
  }
  if (!globalStartConflicts.isEmpty()) {
    helper.add("globalStartConflicts",globalStartConflicts);
  }
  return helper.toString();
}
 

Example 37

From project mdk, under directory /domain/observation/src/main/java/uk/ac/ebi/mdk/domain/observation/sequence/.

Source file: LocalAlignment.java

  19 
vote

@Override public boolean equals(Object obj){
  if (obj instanceof LocalAlignment) {
    LocalAlignment o=(LocalAlignment)obj;
    return Objects.equal(this.query,o.query) && Objects.equal(this.subject,o.subject) && Objects.equal(this.positive,o.positive)&& Objects.equal(this.identity,o.identity)&& Objects.equal(this.length,o.length)&& Objects.equal(this.queryStart,o.queryStart)&& Objects.equal(this.queryEnd,o.queryEnd)&& Objects.equal(this.subjectStart,o.subjectStart)&& Objects.equal(this.subjectEnd,o.subjectEnd)&& Objects.equal(this.expected,o.expected)&& Objects.equal(this.bitScore,o.bitScore)&& Objects.equal(this.querySequence,o.querySequence)&& Objects.equal(this.subjectSequence,o.subjectSequence)&& Objects.equal(this.alignmentSequence,o.alignmentSequence);
  }
  return false;
}
 

Example 38

From project metric, under directory /src/main/java/com/gnapse/common/inflector/.

Source file: Rule.java

  19 
vote

/** 
 * Creates a new rule that maps words to their inflected form by using the specified function. This rule applies to those words for which the function returns a non-null value and does not throw an exception.
 * @param fn the function used to build the rule
 * @return the new rule built from the given function
 */
public static Rule forFunction(final Function<String,String> fn){
  return new Rule(){
    @Override public boolean appliesTo(    String word){
      try {
        return fn.apply(word) != null;
      }
 catch (      Throwable e) {
        return false;
      }
    }
    @Override protected String _applyTo(    String word){
      return fn.apply(word);
    }
    @Override public String toString(){
      return Objects.toStringHelper(Rule.class).addValue("FUNCTION").toString();
    }
  }
;
}
 

Example 39

From project mongolink, under directory /src/main/java/org/mongolink/utils/.

Source file: MethodContainer.java

  19 
vote

@Override public boolean equals(Object o){
  if (o == null) {
    return false;
  }
  if (!(o instanceof MethodContainer)) {
    return false;
  }
  MethodContainer other=(MethodContainer)o;
  return Objects.equal(method,other.method);
}
 

Example 40

From project narya, under directory /core/src/main/java/com/threerings/admin/client/.

Source file: PulldownFieldEditor.java

  19 
vote

@Override protected void displayValue(Object value){
  for (int ii=_value.getItemCount() - 1; ii >= 0; ii--) {
    Choice choice=(Choice)_value.getItemAt(ii);
    if (Objects.equal(value,choice.value)) {
      _value.setSelectedIndex(ii);
      return;
    }
  }
  log.warning("Value in dobj is not settable, disabling choice.",new Exception());
  _value.setEnabled(false);
}