Java Code Examples for org.eclipse.smarthome.core.thing.Thing#equals()

The following examples show how to use org.eclipse.smarthome.core.thing.Thing#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FirmwareRegistryOSGiTest.java    From smarthome with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public @Nullable Firmware getFirmware(Thing thing, String version, @Nullable Locale locale) {
    if (!thing.equals(thing1)) {
        return null;
    }

    if (Locale.ENGLISH.equals(locale)) {
        if (version.equals(FW111_EN.getVersion())) {
            return FW111_EN;
        } else if (version.equals(FW112_EN.getVersion())) {
            return FW112_EN;
        }
    } else {
        if (version.equals(FW111_DE.getVersion())) {
            return FW111_DE;
        } else if (version.equals(FW112_DE.getVersion())) {
            return FW112_DE;
        }
    }
    return null;
}
 
Example 2
Source File: FirmwareRegistryOSGiTest.java    From smarthome with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public @Nullable Set<Firmware> getFirmwares(Thing thing, @Nullable Locale locale) {
    if (!thing.equals(thing1)) {
        return Collections.emptySet();
    }
    if (Locale.ENGLISH.equals(locale)) {
        return Stream.of(FW111_EN, FW112_EN).collect(Collectors.toSet());
    } else {
        return Stream.of(FW111_DE, FW112_DE).collect(Collectors.toSet());
    }
}