
net.yudichev.jiotty.appliance.PowerCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jiotty-appliance Show documentation
Show all versions of jiotty-appliance Show documentation
Appliance abstraction that helps control IoT things
package net.yudichev.jiotty.appliance;
import java.util.Optional;
public enum PowerCommand implements Command {
ON,
OFF;
@Override
public Optional accept(Command.Visitor visitor) {
return visitor instanceof Visitor ?
Optional.of(((Visitor) visitor).visit(this)) :
Optional.empty();
}
@SuppressWarnings("ClassNameSameAsAncestorName") // by design
public interface Visitor extends Command.Visitor {
T visit(PowerCommand command);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy