Example usage for java.util Objects equals

List of usage examples for java.util Objects equals

Introduction

In this page you can find the example usage for java.util Objects equals.

Prototype

public static boolean equals(Object a, Object b) 

Source Link

Document

Returns true if the arguments are equal to each other and false otherwise.

Usage

From source file:de.fraunhofer.iosb.ilt.sta.model.ext.TimeInterval.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from  w w  w .java2  s  .  co  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final TimeInterval other = (TimeInterval) obj;
    if (!Objects.equals(this.interval, other.interval)) {
        return false;
    }
    return true;
}

From source file:mobile.vo.group.GroupVO.java

public static GroupVO create(vo.GroupVO source) {
    GroupVO vo = new GroupVO();

    vo.id = source.getId();//  w ww.ja v  a 2  s . c  o  m
    vo.groupName = source.getGroupName();
    vo.countMem = source.getCountMem();
    vo.createDate = new DateTime(source.getCreateDate()).toString("yyyy-MM-dd HH:mm:ss");
    vo.headUrl = source.getHeadUrl();
    vo.industryId = source.getIndustryId();
    vo.industryName = source.getIndustryName();
    vo.groupInfo = StringUtils.defaultIfEmpty(source.getGroupInfo(), "");
    vo.skillsTags = source.getTags();

    GroupPriv priv = GroupPriv.getByName(source.getGroupPriv());
    if (null != priv) {
        vo.groupPriv = priv.toString();
    }

    vo.maxMemberNum = source.getMaxMemberNum();
    vo.isJoin = source.getIsJoin();

    Type tp = Type.getByName(source.getType());
    if (null != tp) {
        vo.type = tp.toString();
    }

    User user = User.getFromSession(Context.current().session());
    if (null != user && tp == Type.NORMAL) {
        vo.isOwner = Objects.equals(user.getId(), source.getOwnerId());
    }

    return vo;
}

From source file:com.mastfrog.scamper.Address.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from www .  ja  va2  s  .  c  om
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Address other = (Address) obj;
    if (!Objects.equals(this.host, other.host)) {
        return false;
    }
    return this.port == other.port;
}

From source file:com.okta.sdk.models.log.LogUserAgent.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from w ww. j av a 2s  .c om*/
    if (obj == null || !(obj instanceof LogUserAgent)) {
        return false;
    }
    final LogUserAgent other = (LogUserAgent) obj;
    return Objects.equals(this.rawUserAgent, other.rawUserAgent) && Objects.equals(this.os, other.os)
            && Objects.equals(this.browser, other.browser);
}

From source file:com.spotify.docker.client.messages.CpuUsage.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }//from www .ja  v  a 2  s . co  m
    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    final CpuUsage that = (CpuUsage) o;

    return Objects.equals(this.totalUsage, that.totalUsage)
            && Objects.equals(this.percpuUsage, that.percpuUsage)
            && Objects.equals(this.usageInKernelmode, that.usageInKernelmode)
            && Objects.equals(this.usageInUsermode, that.usageInUsermode);
}

From source file:com.cloud.agent.api.element.ApplyStaticNatVspCommand.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }/*from   w  ww  . j  a v  a  2s.com*/

    if (!(o instanceof ApplyStaticNatVspCommand)) {
        return false;
    }

    ApplyStaticNatVspCommand that = (ApplyStaticNatVspCommand) o;

    return super.equals(that) && Objects.equals(_network, that._network)
            && Objects.equals(_staticNatDetails, that._staticNatDetails);
}

From source file:th.co.geniustree.dental.model.UnitProduct.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }// ww  w  .j a  v  a2 s  .com
    if (getClass() != obj.getClass()) {
        return false;
    }
    final UnitProduct other = (UnitProduct) obj;
    if (!Objects.equals(this.id, other.id)) {
        return false;
    }
    return true;
}

From source file:fr.mycellar.domain.admin.Configuration.java

@Override
protected boolean dataEquals(IdentifiedEntity other) {
    Configuration configuration = (Configuration) other;
    return Objects.equals(getKey(), configuration.getKey());
}

From source file:com.cloud.agent.api.guru.ImplementNetworkVspCommand.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }//from   ww  w.j av  a2  s . co  m

    if (!(o instanceof ImplementNetworkVspCommand)) {
        return false;
    }

    ImplementNetworkVspCommand that = (ImplementNetworkVspCommand) o;

    return super.equals(that) && Objects.equals(_dhcpOption, that._dhcpOption)
            && Objects.equals(_network, that._network);
}

From source file:com.cloud.agent.api.sync.SyncDomainCommand.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (!(o instanceof SyncDomainCommand))
        return false;
    if (!super.equals(o))
        return false;

    SyncDomainCommand that = (SyncDomainCommand) o;

    return super.equals(that) && Objects.equals(_action, that._action) && Objects.equals(_domain, that._domain);
}