类com.google.common.base.Objects源码实例Demo

下面列出了怎么用com.google.common.base.Objects的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Rails   文件: ForcedRocketExchange.java
@Override
protected boolean equalsAs(PossibleAction pa, boolean asOption) {
    // identity always true
    if (pa == this) return true;
    //  super checks both class identity and super class attributes
    if (!super.equalsAs(pa, asOption)) return false;

    // no asOption attributes
    if (asOption) return true;

    // check asAction attributes
    ForcedRocketExchange action = (ForcedRocketExchange)pa;
    return Objects.equal(this.companyToReceiveTrain, action.companyToReceiveTrain)
            && Objects.equal(this.trainToReplace, action.trainToReplace)
    ;
}
 
源代码2 项目: o2oa   文件: BaseAction.java
@SuppressWarnings("unchecked")
private List<Class<?>> listAssemble() throws Exception {
	if (null == assembles) {
		synchronized (BaseAction.class) {
			if (null == assembles) {
				try (ScanResult scanResult = new ClassGraph().enableAnnotationInfo().scan()) {
					assembles = new CopyOnWriteArrayList<Class<?>>();
					List<ClassInfo> list = new ArrayList<>();
					list.addAll(scanResult.getClassesWithAnnotation(Module.class.getName()));
					list = list.stream().sorted(Comparator.comparing(ClassInfo::getName))
							.collect(Collectors.toList());
					for (ClassInfo info : list) {
						Class<?> cls = Class.forName(info.getName());
						Module module = cls.getAnnotation(Module.class);
						if (Objects.equal(module.type(), ModuleType.ASSEMBLE)) {
							assembles.add(cls);
						}
					}
				}
			}
		}
	}
	return assembles;
}
 
源代码3 项目: atomix   文件: DefaultLeaderElectorService.java
@Override
public boolean anoint(String topic, byte[] id) {
  try {
    Leadership<byte[]> oldLeadership = leadership(topic);
    ElectionState electionState = elections.computeIfPresent(topic,
        (k, v) -> v.transferLeadership(id, termCounter(topic)));
    Leadership<byte[]> newLeadership = leadership(topic);
    if (!Objects.equal(oldLeadership, newLeadership)) {
      notifyLeadershipChange(topic, oldLeadership, newLeadership);
    }
    return (electionState != null
        && electionState.leader() != null
        && Arrays.equals(id, electionState.leader().id()));
  } catch (Exception e) {
    getLogger().error("State machine operation failed", e);
    throwIfUnchecked(e);
    throw new RuntimeException(e);
  }
}
 
源代码4 项目: api-mining   文件: IAstAnnotatedTokenizer.java
@Override
public boolean equals(final Object obj) {
	if (this == obj) {
		return true;
	}
	if (obj == null) {
		return false;
	}
	if (getClass() != obj.getClass()) {
		return false;
	}
	final AstAnnotatedToken other = (AstAnnotatedToken) obj;
	return Objects.equal(other.token, token)
			&& Objects.equal(other.tokenAstNode, tokenAstNode)
			&& Objects.equal(other.parentTokenAstNode,
					parentTokenAstNode);
}
 
源代码5 项目: xtext-extras   文件: XbaseFormatter.java
protected XClosure builder(final List<XExpression> params) {
  XClosure _xifexpression = null;
  XExpression _last = IterableExtensions.<XExpression>last(params);
  boolean _tripleNotEquals = (_last != null);
  if (_tripleNotEquals) {
    XClosure _xblockexpression = null;
    {
      final EObject grammarElement = this.textRegionExtensions.grammarElement(IterableExtensions.<XExpression>last(params));
      XClosure _xifexpression_1 = null;
      if (((Objects.equal(grammarElement, this.grammar.getXMemberFeatureCallAccess().getMemberCallArgumentsXClosureParserRuleCall_1_1_4_0()) || 
        Objects.equal(grammarElement, this.grammar.getXFeatureCallAccess().getFeatureCallArgumentsXClosureParserRuleCall_4_0())) || 
        Objects.equal(grammarElement, this.grammar.getXConstructorCallAccess().getArgumentsXClosureParserRuleCall_5_0()))) {
        XExpression _last_1 = IterableExtensions.<XExpression>last(params);
        _xifexpression_1 = ((XClosure) _last_1);
      }
      _xblockexpression = _xifexpression_1;
    }
    _xifexpression = _xblockexpression;
  }
  return _xifexpression;
}
 
源代码6 项目: activitystreams   文件: Model.java
/**
 * Method toString.

 * @return String */
public String toString() {
  return Objects.toStringHelper(Model.class)
    .omitNullValues()
    .add("Parent", parent)
    .add("Properties", properties)
    .toString();
}
 
源代码7 项目: xsemantics   文件: MyExtendedTypeSystem.java
protected Result<Boolean> applyRuleMyModelSubtype(final RuleEnvironment G, final RuleApplicationTrace _trace_, final MyModel m1, final MyModel m2) throws RuleFailedException {
  String _type = m1.getType();
  String _type_1 = m2.getType();
  /* m1.type == m2.type */
  if (!Objects.equal(_type, _type_1)) {
    sneakyThrowRuleFailedException("m1.type == m2.type");
  }
  return new Result<Boolean>(true);
}
 
@Override
public void onSubchannelState(ConnectivityStateInfo rawState) {
  if (Objects.equal(this.rawState.getState(), READY)
      && !Objects.equal(rawState.getState(), READY)) {
    // A connection was lost.  We will reset disabled flag because health check
    // may be available on the new connection.
    disabled = false;
  }
  if (Objects.equal(rawState.getState(), SHUTDOWN)) {
    helperImpl.hcStates.remove(this);
  }
  this.rawState = rawState;
  adjustHealthCheck();
}
 
源代码9 项目: crnk-framework   文件: CountryTranslationPK.java
@Override
public boolean equals(Object obj) {
	if (obj == null || getClass() != obj.getClass()) {
		return false;
	}
	CountryTranslationPK other = (CountryTranslationPK) obj;
	return Objects.equal(other.lang, lang) && Objects.equal(other.country, country);
}
 
@Override
public boolean equals(Object object) {
  if (object == null || !(object instanceof TransactionHistoryResultEntryExt)) {
    return false;
  }

  TransactionHistoryResultEntryExt other = (TransactionHistoryResultEntryExt) object;
  return Objects.equal(this.v, other.v);
}
 
源代码11 项目: codebuff   文件: BaseEncoding.java
@Override
public boolean equals(@Nullable Object other) {
  if (other instanceof StandardBaseEncoding) {
    StandardBaseEncoding that = (StandardBaseEncoding) other;
    return this.alphabet.equals(that.alphabet)
    && Objects.equal(this.paddingChar, that.paddingChar);
  }
  return false;
}
 
源代码12 项目: gerrit-rest-java-client   文件: PermissionInfo.java
@Override
public boolean equals(Object obj) {
  if (obj instanceof PermissionInfo) {
    PermissionInfo p = (PermissionInfo) obj;
    return Objects.equal(label, p.label)
        && Objects.equal(exclusive, p.exclusive)
        && Objects.equal(rules, p.rules);
  }
  return false;
}
 
源代码13 项目: ganttproject   文件: MiltonResourceFactory.java
@Override
public boolean equals(Object obj) {
  if (obj instanceof Key == false) {
    return false;
  }
  Key that = (Key) obj;
  return Objects.equal(this.url, that.url) && Objects.equal(this.username, that.username) && Objects.equal(this.password, that.password);
}
 
源代码14 项目: cava   文件: Block.java
@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof Block)) {
    return false;
  }
  Block other = (Block) obj;
  return Objects.equal(header, other.header) && Objects.equal(body, other.body);
}
 
源代码15 项目: onos   文件: TeLinkEventSubject.java
@Override
public boolean equals(Object object) {
    if (this == object) {
        return true;
    }
    if (object instanceof TeLinkEventSubject) {
        TeLinkEventSubject that = (TeLinkEventSubject) object;
        return Objects.equal(key, that.key) &&
                Objects.equal(teLink, that.teLink);
    }
    return false;
}
 
源代码16 项目: The-5zig-Mod   文件: ClassProxy.java
public static void setSignText(Object signTile, String[] text) {
	for (int i = 0; i < text.length; i++) {
		fb[] components = ((asv) signTile).a;
		if (!Objects.equal(components[i].d(), text[i])) {
			components[i] = new fh(text[i]);
		}
	}
}
 
源代码17 项目: arctic-sea   文件: JSONEncoderKey.java
@Override
public boolean equals(Object obj) {
    if (obj != null && obj.getClass() == getClass()) {
        JSONEncoderKey key = (JSONEncoderKey) obj;
        return Objects.equal(getType(), key.getType());
    }
    return false;
}
 
源代码18 项目: intellij   文件: DirectoryEntry.java
@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  DirectoryEntry that = (DirectoryEntry) o;
  return Objects.equal(included, that.included) && Objects.equal(directory, that.directory);
}
 
源代码19 项目: lttrs-android   文件: MailboxOverwriteEntity.java
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    MailboxOverwriteEntity entity = (MailboxOverwriteEntity) o;
    return value == entity.value &&
            Objects.equal(threadId, entity.threadId) &&
            Objects.equal(name, entity.name) &&
            Objects.equal(role, entity.role);
}
 
源代码20 项目: Gatekeeper   文件: AccessRequest.java
@Override
public int hashCode() {
    return Objects.hashCode(id,
            requestorId,
            requestorName,
            requestorEmail,
            account, region, approverComments, actionedByUserId, actionedByUserName, ticketId, requestReason, platform, hours, users, instances);
}
 
源代码21 项目: aws-athena-query-federation   文件: TableName.java
@Override
public boolean equals(Object o)
{
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    TableName that = (TableName) o;

    return Objects.equal(this.schemaName, that.schemaName) &&
            Objects.equal(this.tableName, that.tableName);
}
 
源代码22 项目: java-stellar-sdk   文件: OfferEntry.java
@Override
public boolean equals(Object object) {
  if (object == null || !(object instanceof OfferEntryExt)) {
    return false;
  }

  OfferEntryExt other = (OfferEntryExt) object;
  return Objects.equal(this.v, other.v);
}
 
源代码23 项目: joal   文件: AppConfiguration.java
@Override
public boolean equals(final Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    final AppConfiguration that = (AppConfiguration) o;
    return Objects.equal(minUploadRate, that.minUploadRate) &&
            Objects.equal(maxUploadRate, that.maxUploadRate) &&
            Objects.equal(simultaneousSeed, that.simultaneousSeed) &&
            Objects.equal(client, that.client) &&
            Objects.equal(keepTorrentWithZeroLeechers, that.keepTorrentWithZeroLeechers);
}
 
源代码24 项目: james-project   文件: SearchQuery.java
@Override
public boolean equals(Object obj) {
    if (obj instanceof NumericOperator) {
        NumericOperator that = (NumericOperator) obj;

        return Objects.equal(this.value, that.value)
            && Objects.equal(this.type, that.type);
    }
    return false;
}
 
源代码25 项目: onedev   文件: DefaultPullRequestChangeManager.java
@Transactional
@Override
public void changeDescription(PullRequest request, @Nullable String description) {
	String prevDescription = request.getDescription();
	if (!Objects.equal(prevDescription, description)) {
		request.setDescription(description);
		
		PullRequestChange change = new PullRequestChange();
		change.setDate(new Date());
		change.setRequest(request);
		change.setData(new PullRequestDescriptionChangeData(prevDescription, description));
		change.setUser(SecurityUtils.getUser());
		save(change);
	}
}
 
源代码26 项目: james-project   文件: UserName.java
@Override
public boolean equals(Object o) {
    if (o instanceof UserName) {
        UserName that = (UserName) o;
        return Objects.equal(value, that.value);
    }
    return false;
}
 
源代码27 项目: gerrit-rest-java-client   文件: ProblemInfo.java
@Override
public boolean equals(Object o) {
  if (!(o instanceof ProblemInfo)) {
    return false;
  }
  ProblemInfo p = (ProblemInfo) o;
  return Objects.equal(message, p.message)
      && Objects.equal(status, p.status)
      && Objects.equal(outcome, p.outcome);
}
 
源代码28 项目: xtext-extras   文件: HiddenLeafAccess.java
protected List<ILeafNode> findPreviousHiddenLeafs(final INode node) {
  List<ILeafNode> _xblockexpression = null;
  {
    INode current = node;
    while ((current instanceof ICompositeNode)) {
      current = ((ICompositeNode)current).getLastChild();
    }
    final ArrayList<ILeafNode> result = CollectionLiterals.<ILeafNode>newArrayList();
    if ((current != null)) {
      final NodeIterator ni = new NodeIterator(current);
      while (ni.hasPrevious()) {
        {
          final INode previous = ni.previous();
          if (((!Objects.equal(previous, current)) && (previous instanceof ILeafNode))) {
            boolean _isHidden = ((ILeafNode) previous).isHidden();
            if (_isHidden) {
              result.add(((ILeafNode) previous));
            } else {
              return ListExtensions.<ILeafNode>reverse(result);
            }
          }
        }
      }
    }
    _xblockexpression = ListExtensions.<ILeafNode>reverse(result);
  }
  return _xblockexpression;
}
 
源代码29 项目: java-platform   文件: Application.java
private void initExtension() {
	if (extensions != null) {
		List<ExtensionEntity> moduleEntities = extensionService.findAllExtension();
		for (Extension module : extensions) {
			ExtensionEntity moduleEntity = findModuleEntityByCode(moduleEntities, module.getCode());
			boolean isNew = moduleEntity == null;

			boolean isUpdate = isNew || !Objects.equal(module.getVersion(), moduleEntity.getVersion());

			module.init(this, isNew, isUpdate, isNew ? null : moduleEntity.getVersion());

			if (isNew) {
				moduleEntity = extensionService.newEntity();
				moduleEntity.setCreatedBy(module.getAuthor());
				moduleEntity.setCreatedDate(new Date());
				moduleEntity.setType(Type.Extension);
			}
			if (isUpdate) {
				moduleEntity.setCode(module.getCode());
				moduleEntity.setName(module.getName());
				moduleEntity.setVersion(module.getVersion());
				moduleEntity.setLastModifiedBy(module.getAuthor());
				moduleEntity.setLastModifiedDate(new Date());

				extensionService.save(moduleEntity);
			}
		}
	}
}
 
源代码30 项目: java-stellar-sdk   文件: String64.java
@Override
public boolean equals(Object object) {
  if (object == null || !(object instanceof String64)) {
    return false;
  }

  String64 other = (String64) object;
  return Objects.equal(this.string64, other.string64);
}