public DataItemValue build () { return new DataItemValue ( this.value, this.attributes, this.subscriptionState, this.subscriptionError ); }
public DataItemValue build () { return new DataItemValue ( this.value, this.attributes, this.subscriptionState, this.subscriptionError ); }
private static DataItemValue convert ( final Entry entry ) { final Map<String, Variant> attributes = new HashMap<> ( 10 ); attributes.put ( "timestamp", Variant.valueOf ( entry.getTimestamp () ) ); attributes.put ( "sfp.register", Variant.valueOf ( entry.getRegister () ) ); attributes.put ( "error", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.ERROR ) ) ); attributes.put ( "alarm", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.ALARM ) ) ); attributes.put ( "warning", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.WARNING ) ) ); attributes.put ( "error.ackRequired", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.ERROR_ACK ) ) ); attributes.put ( "alarm.ackRequired", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.ALARM_ACK ) ) ); attributes.put ( "warning.ackRequired", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.WARNING_ACK ) ) ); attributes.put ( "manual", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.MANUAL_OVERRIDE ) ) ); attributes.put ( "blocked", Variant.valueOf ( entry.getStates ().contains ( DataUpdate.State.BLOCKED ) ) ); return new DataItemValue ( entry.getValue (), attributes, SubscriptionState.CONNECTED ); }