Example usage for java.lang System equals

List of usage examples for java.lang System equals

Introduction

In this page you can find the example usage for java.lang System equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.opennaas.extensions.roadm.wonesys.commandsets.commands.psroadm.SetChannel.java

/**
 * //from w w w . j  a v  a  2 s . co  m
 * @param srcPort
 * @return true if given port has connections and all of them are connected to ports in the same System than given port, or false otherwise.
 */
private static boolean isLocallyConnectedOnly(NetworkPort srcPort) {

    org.opennaas.extensions.router.model.System srcPortSystem = srcPort.getModule().getSystems().get(0);

    if (srcPort.getOutgoingDeviceConnections().isEmpty())
        return false;

    for (LogicalDevice otherPort : srcPort.getOutgoingDeviceConnections()) {
        if (otherPort instanceof NetworkPort) {
            org.opennaas.extensions.router.model.System otherPortSystem = ((NetworkPort) otherPort).getModule()
                    .getSystems().get(0);
            if (!srcPortSystem.equals(otherPortSystem))
                return false;
        }
    }

    return true;
}