001package jmri.jmrit.logixng; 002 003/** 004 * An enum with the values "is" and "is not" 005 * 006 * @author Daniel Bergqvist 2019 007 */ 008public enum Is_IsNot_Enum { 009 010 Is(Bundle.getMessage("IsIsNotEnum_Is")), 011 IsNot(Bundle.getMessage("IsIsNotEnum_IsNot")); 012 013 private final String _text; 014 015 private Is_IsNot_Enum(String text) { 016 this._text = text; 017 } 018 019 public Is_IsNot_Enum getOpposite() { 020 switch (this) { 021 case Is: return IsNot; 022 case IsNot: return Is; 023 default: throw new UnsupportedOperationException("Unknown enum: "+this.name()); 024 } 025 } 026 027 @Override 028 public String toString() { 029 return _text; 030 } 031 032}