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:net.bluemix.connectors.core.info.WatsonNaturalLanguageClassifierServiceInfo.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from w ww.j  ava2  s.com
    if (obj == null || getClass() != obj.getClass()) {
        return false;
    }
    final WatsonNaturalLanguageClassifierServiceInfo other = (WatsonNaturalLanguageClassifierServiceInfo) obj;
    if (!Objects.equals(this.username, other.username)) {
        return false;
    }
    if (!Objects.equals(this.password, other.password)) {
        return false;
    }
    if (!Objects.equals(this.url, other.url)) {
        return false;
    }
    return Objects.equals(this.id, other.id);
}

From source file:com.autodesk.client.model.JsonApiRelationshipsLinksInternalResource.java

@Override
public boolean equals(java.lang.Object o) {
    if (this == o) {
        return true;
    }//from  www. j a  v a 2 s .c  om
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    JsonApiRelationshipsLinksInternalResource jsonApiRelationshipsLinksInternalResource = (JsonApiRelationshipsLinksInternalResource) o;
    return Objects.equals(this.links, jsonApiRelationshipsLinksInternalResource.links)
            && Objects.equals(this.data, jsonApiRelationshipsLinksInternalResource.data);
}

From source file:com.vmware.photon.controller.model.adapters.vsphere.CustomizationClient.java

public void customizeNic(String macAddress, NetworkInterfaceDescription config, SubnetState subnetState,
        CustomizationSpec template) {/*w  w  w  .  j a  v a  2  s  .  co  m*/
    // remove existing mapping
    template.getNicSettingMap().removeIf(x -> Objects.equals(x.getMacAddress(), macAddress));

    CustomizationAdapterMapping mapping = new CustomizationAdapterMapping();
    mapping.setMacAddress(macAddress);
    CustomizationIPSettings adapter = new CustomizationIPSettings();
    mapping.setAdapter(adapter);

    adapter.setSubnetMask(cidr2mask(subnetState.subnetCIDR));
    adapter.getGateway().add(subnetState.gatewayAddress);
    adapter.setDnsDomain(subnetState.domain);
    CustomizationFixedIp ipGen = new CustomizationFixedIp();
    ipGen.setIpAddress(config.address);
    adapter.setIp(ipGen);

    template.getNicSettingMap().add(mapping);

    if (isLinux()) {
        CustomizationLinuxPrep identity = new CustomizationLinuxPrep();
        template.setIdentity(identity);
        identity.setDomain(subnetState.domain);

        CustomizationFixedName name = new CustomizationFixedName();
        name.setName(this.state.name);
        identity.setHostName(name);

        template.setOptions(new CustomizationLinuxOptions());
    }
}

From source file:com.autodesk.client.model.Forbidden.java

@Override
public boolean equals(java.lang.Object o) {
    if (this == o) {
        return true;
    }//from  ww  w .  j  a va2s  .co  m
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    Forbidden forbidden = (Forbidden) o;
    return Objects.equals(this.jsonapi, forbidden.jsonapi) && Objects.equals(this.errors, forbidden.errors);
}

From source file:eu.eubrazilcc.lvl.storage.oauth2.AccessToken.java

@Override
public boolean equals(final Object obj) {
    if (obj == null || !(obj instanceof AccessToken)) {
        return false;
    }/*from  w ww . j  a va  2  s.  c  om*/
    final AccessToken other = AccessToken.class.cast(obj);
    return Objects.equals(token, other.token) && Objects.equals(expiresIn, other.expiresIn)
            && Objects.equals(issuedAt, other.issuedAt) && Objects.equals(ownerId, other.ownerId)
            && Objects.equals(scopes, other.scopes);
}

From source file:com.autodesk.client.model.JsonApiCollection.java

@Override
public boolean equals(java.lang.Object o) {
    if (this == o) {
        return true;
    }/*  www.j  ava  2s.c o m*/
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    JsonApiCollection jsonApiCollection = (JsonApiCollection) o;
    return Objects.equals(this.jsonapi, jsonApiCollection.jsonapi)
            && Objects.equals(this.data, jsonApiCollection.data);
}

From source file:com.haulmont.cuba.web.jmx.JmxConnectionHelper.java

protected static <T> T withConnection(JmxInstance instance, JmxAction<T> action) {
    try {//w ww .  ja v a 2 s.  c o  m
        if (Objects.equals(instance.getId(), LOCAL_JMX_INSTANCE_ID)) {
            return action.perform(instance, getLocalConnection());
        } else {
            MBeanServerConnectionFactoryBean factoryBean = new MBeanServerConnectionFactoryBean();
            String address = instance.getAddress();
            if (!address.startsWith("service:")) {
                address = "service:jmx:rmi:///jndi/rmi://" + address + "/jmxrmi";
            }
            factoryBean.setServiceUrl(address);

            String username = instance.getLogin();
            if (StringUtils.isNotEmpty(username)) {
                Properties properties = new Properties();
                properties.put("jmx.remote.credentials", new String[] { username, instance.getPassword() });
                factoryBean.setEnvironment(properties);
            }

            factoryBean.afterPropertiesSet();

            MBeanServerConnection connection = factoryBean.getObject();
            T result;
            try {
                result = action.perform(instance, connection);
            } finally {
                try {
                    factoryBean.destroy();
                } catch (Exception ignored) {
                }
            }
            return result;
        }
    } catch (Exception e) {
        throw new JmxControlException(e);
    }
}

From source file:fr.mycellar.domain.stock.CellarShare.java

@Override
protected boolean dataEquals(IdentifiedEntity other) {
    CellarShare cellarShare = (CellarShare) other;
    return Objects.equals(getEmail(), cellarShare.getEmail())
            && Objects.equals(getAccessRight(), cellarShare.getAccessRight())
            && Objects.equals(getCellar(), cellarShare.getCellar());
}

From source file:fr.mycellar.domain.wine.Region.java

@Override
protected boolean dataEquals(IdentifiedEntity other) {
    Region region = (Region) other;
    return Objects.equals(getName(), region.getName()) && Objects.equals(getCountry(), region.getCountry());
}