本文整理匯總了Java中org.apache.commons.lang.ObjectUtils.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectUtils.equals方法的具體用法?Java ObjectUtils.equals怎麽用?Java ObjectUtils.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang.ObjectUtils
的用法示例。
在下文中一共展示了ObjectUtils.equals方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setTaskOwner
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
/**
* @param task Task
* @param properties Map<QName, Serializable>
*/
private void setTaskOwner(Task task, Map<QName, Serializable> properties)
{
QName ownerKey = ContentModel.PROP_OWNER;
if (properties.containsKey(ownerKey))
{
Serializable owner = properties.get(ownerKey);
if (owner != null && !(owner instanceof String))
{
throw getInvalidPropertyValueException(ownerKey, owner);
}
String assignee = (String) owner;
String currentAssignee = task.getAssignee();
// Only set the assignee if the value has changes to prevent
// triggering assignementhandlers when not needed
if (ObjectUtils.equals(currentAssignee, assignee)==false)
{
activitiUtil.getTaskService().setAssignee(task.getId(), assignee);
}
}
}
示例2: compareRecords
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
/**
* Compare all the columns for these records.
*
* @param table the active {@link Table}
* @param recordNumber The current record number
* @param record1 The first record
* @param record2 The second record
*/
private void compareRecords(Table table, int recordNumber, Record record1, Record record2, List<Column> primaryKeys) {
for (Column column : FluentIterable.from(table.columns()).filter(excludingExcludedColumns())) {
String columnName = column.getName();
Object value1 = convertToComparableType(column, record1);
Object value2 = convertToComparableType(column, record2);
if (!ObjectUtils.equals(value1, value2)) {
differences.add(String.format(
"Table [%s]: Mismatch on key %s column [%s] row [%d]: [%s]<>[%s]",
table.getName(),
keyColumnsIds(record1, record2, primaryKeys),
columnName,
recordNumber,
value1,
value2
));
}
}
}
示例3: isAllowed
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
/**
* Check if the given request is allowed on the whitelist
*/
public boolean isAllowed(final String host, final String addr) {
final boolean allowed = isAllowed(addr);
if (allowed) {
return true;
}
if (ObjectUtils.equals(host, addr)) {
// Try to resolve the host name to one of the known hosts
for (final String current : getAllowedHosts()) {
try {
// Check if one of the addresses on the whitelisted hosts is the request address
final InetAddress[] addresses = InetAddress.getAllByName(current);
for (final InetAddress address : addresses) {
if (address.getHostAddress().equals(addr)) {
return true;
}
}
} catch (final UnknownHostException e) {
// Go on
}
}
return false;
} else {
return isAllowed(host);
}
}
示例4: execute
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
@Override
public void execute() throws ServiceAbortException {
page.clearErrorMessageList();
String password = page.getPassword();
String passwordConf = page.getPasswordConf();
if (!ObjectUtils.equals(password, passwordConf)) {
throw new ServiceAbortException(ApplicationMessageCode.PASSWORD_UNMATCH);
} else {
page.setContextUser(SETUP_USER_ID);
List<SysUsers> userList = new ArrayList<>();
userList.add(setupUserDto());
page.userService.save(userList);
page.setVisibled(3);
page.setPageTitle(3);
page.setBackPage(2);
}
}
示例5: createOrupdateConfigObject
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
private void createOrupdateConfigObject(final Date date, final String componentName, final ConfigKey<?> key, final String value) {
ConfigurationVO vo = _configDao.findById(key.key());
if (vo == null) {
vo = new ConfigurationVO(componentName, key);
vo.setUpdated(date);
if (value != null) {
vo.setValue(value);
}
_configDao.persist(vo);
} else {
if (vo.isDynamic() != key.isDynamic() || !ObjectUtils.equals(vo.getDescription(), key.description()) || !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue()) ||
!ObjectUtils.equals(vo.getScope(), key.scope().toString()) ||
!ObjectUtils.equals(vo.getComponent(), componentName)) {
vo.setDynamic(key.isDynamic());
vo.setDescription(key.description());
vo.setDefaultValue(key.defaultValue());
vo.setScope(key.scope().toString());
vo.setComponent(componentName);
vo.setUpdated(date);
_configDao.persist(vo);
}
}
}
示例6: updatePortAndContextPath
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
private void updatePortAndContextPath(HttpServletRequest request) {
int port = Integer.parseInt(System.getProperty("subsonic.port", String.valueOf(request.getLocalPort())));
int httpsPort = Integer.parseInt(System.getProperty("subsonic.httpsPort", "0"));
String contextPath = request.getContextPath().replace("/", "");
if (settingsService.getPort() != port) {
settingsService.setPort(port);
settingsService.save();
}
if (settingsService.getHttpsPort() != httpsPort) {
settingsService.setHttpsPort(httpsPort);
settingsService.save();
}
if (!ObjectUtils.equals(settingsService.getUrlRedirectContextPath(), contextPath)) {
settingsService.setUrlRedirectContextPath(contextPath);
settingsService.save();
}
}
示例7: isEqualStyle
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
public static boolean isEqualStyle(TextStyleType s1, TextStyleType s2) {
return (
ObjectUtils.equals(s1.getFontFamily(), s2.getFontFamily()) &&
ObjectUtils.equals(s1.isSerif(), s2.isSerif()) &&
ObjectUtils.equals(s1.isMonospace(), s2.isMonospace()) &&
ObjectUtils.equals(s1.getFontSize(), s2.getFontSize()) &&
ObjectUtils.equals(s1.getKerning(), s2.getKerning()) &&
ObjectUtils.equals( s1.getTextColour(), s2.getTextColour()) &&
ObjectUtils.equals(s1.getBgColour(), s2.getBgColour()) &&
ObjectUtils.equals(s1.isReverseVideo(), s2.isReverseVideo()) &&
ObjectUtils.equals(s1.isBold(), s2.isBold()) &&
ObjectUtils.equals(s1.isItalic(), s2.isItalic()) &&
ObjectUtils.equals(s1.isUnderlined(), s2.isUnderlined()) &&
ObjectUtils.equals(s1.isSubscript(), s2.isSubscript()) &&
ObjectUtils.equals(s1.isSuperscript(), s2.isSuperscript()) &&
ObjectUtils.equals(s1.isStrikethrough(), s2.isStrikethrough()) &&
ObjectUtils.equals(s1.isSmallCaps(), s2.isSmallCaps()) &&
ObjectUtils.equals(s1.isLetterSpaced(), s2.isLetterSpaced())
);
}
示例8: equals
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ForexOptionSingleBarrierDefinition other = (ForexOptionSingleBarrierDefinition) obj;
if (_barrier != other._barrier) {
return false;
}
if (Double.doubleToLongBits(_rebate) != Double.doubleToLongBits(other._rebate)) {
return false;
}
if (!ObjectUtils.equals(_underlyingOption, other._underlyingOption)) {
return false;
}
return true;
}
示例9: setPerson
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
/**
* Set the value of Person
*
* @param v new value
*/
public void setPerson(Integer v) throws TorqueException
{
if (!ObjectUtils.equals(this.person, v))
{
this.person = v;
setModified(true);
}
if (aTPerson != null && !ObjectUtils.equals(aTPerson.getObjectID(), v))
{
aTPerson = null;
}
}
示例10: setMailTemplate
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
/**
* Set the value of MailTemplate
*
* @param v new value
*/
public void setMailTemplate(Integer v) throws TorqueException
{
if (!ObjectUtils.equals(this.mailTemplate, v))
{
this.mailTemplate = v;
setModified(true);
}
if (aTMailTemplate != null && !ObjectUtils.equals(aTMailTemplate.getObjectID(), v))
{
aTMailTemplate = null;
}
}
示例11: equals
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof EquityDefinition)) {
return false;
}
final EquityDefinition other = (EquityDefinition) obj;
if (Double.compare(_numberOfShares, other._numberOfShares) != 0) {
return false;
}
if (!ObjectUtils.equals(_currency, other._currency)) {
return false;
}
if (!ObjectUtils.equals(_entity, other._entity)) {
return false;
}
return true;
}
示例12: equals
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DefaultModuleDependencySpec that = (DefaultModuleDependencySpec) o;
return ObjectUtils.equals(group, that.group)
&& ObjectUtils.equals(name, that.name)
&& ObjectUtils.equals(version, that.version);
}
示例13: equals
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DefaultLibraryBinaryDependencySpec that = (DefaultLibraryBinaryDependencySpec) o;
return ObjectUtils.equals(projectPath, that.projectPath)
&& ObjectUtils.equals(libraryName, that.libraryName)
&& ObjectUtils.equals(variant, that.variant);
}
示例14: equals
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DefaultProjectDependencySpec that = (DefaultProjectDependencySpec) o;
return ObjectUtils.equals(projectPath, that.projectPath)
&& ObjectUtils.equals(libraryName, that.libraryName);
}
示例15: checkNotDuplicate
import org.apache.commons.lang.ObjectUtils; //導入方法依賴的package包/類
private void checkNotDuplicate(MavenNormalizedPublication publication, Set<MavenArtifact> artifacts, String extension, String classifier) {
for (MavenArtifact artifact : artifacts) {
if (ObjectUtils.equals(artifact.getExtension(), extension) && ObjectUtils.equals(artifact.getClassifier(), classifier)) {
String message = String.format(
"multiple artifacts with the identical extension and classifier ('%s', '%s').", extension, classifier
);
throw new InvalidMavenPublicationException(publication.getName(), message);
}
}
}