当前位置: 首页>>代码示例>>Java>>正文


Java ObjectUtils.equals方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ActivitiPropertyConverter.java

示例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
      ));
    }
  }
}
 
开发者ID:alfasoftware,项目名称:morf,代码行数:30,代码来源:TableDataHomology.java

示例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);
    }
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:29,代码来源:WhitelistValidator.java

示例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);
    }
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:21,代码来源:SetupPage.java

示例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);
        }
    }
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:24,代码来源:ConfigDepotImpl.java

示例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();
        }
    }
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:21,代码来源:MultiController.java

示例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())
    );
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:21,代码来源:GuiUtil.java

示例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;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:24,代码来源:ForexOptionSingleBarrierDefinition.java

示例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;
    }

}
 
开发者ID:trackplus,项目名称:Genji,代码行数:22,代码来源:BaseTTemplatePerson.java

示例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;
    }

}
 
开发者ID:trackplus,项目名称:Genji,代码行数:22,代码来源:BaseTMailTemplateDef.java

示例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;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:21,代码来源:EquityDefinition.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:DefaultModuleDependencySpec.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:DefaultLibraryBinaryDependencySpec.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultProjectDependencySpec.java

示例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);
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:ValidatingMavenPublisher.java


注:本文中的org.apache.commons.lang.ObjectUtils.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。