public void addClientIfNotPresent(DeviceGuiElement device) {
        boolean add = true;
        for (DeviceGuiElement element : clients) {
            if (element != null
                    && element.getName().equals(device.getName())
                    && element.getAddress().equals(device.getAddress())) {
                add = false; //already in the list
            }
        }

        if (add) {
            clients.add(device);
        }
    }
public void addClientIfNotPresent(DeviceGuiElement device) {
        boolean add = true;
        for (DeviceGuiElement element : clients) {
            if (element != null
                    && element.getName().equals(device.getName())
                    && element.getAddress().equals(device.getAddress())) {
                add = false; 
            }
        }

        if (add) {
            clients.add(device);
        }
    }
public void addClientIfNotPresent ( DeviceGuiElement device ) { boolean add = true ; for ( DeviceGuiElement element : clients ) { if ( element != null && element . getName ( ) . equals ( device . getName ( ) ) && element . getAddress ( ) . equals ( device . getAddress ( ) ) ) { add = false ; //already in the list } } if ( add ) { clients . add ( device ) ; } }
Method to add a client inside the list in a secure way.
The client is added only if isn't already inside the list.

@param device {@link DeviceGuiElement} to add.
Method to add a client inside the list in a secure way . The client is added only if isn t already inside the list .