public Throwable getSubscriptionError () { if ( this.value == null ) { return null; } return this.value.getSubscriptionError (); }
/** * Get the subscription error or <code>null</code> if there was none * * @return the subscription error * @deprecated You should use {@link #getSnapshotValue()} instead to get a * consistent value */ @Deprecated public Throwable getSubscriptionError () { return this.value.getSubscriptionError (); }
/** * Get the subscription error or <code>null</code> if there was none * * @return the subscription error * @deprecated You should use {@link #getSnapshotValue()} instead to get a * consistent value */ @Deprecated public Throwable getSubscriptionError () { return this.value.getSubscriptionError (); }
public Builder ( final DataItemValue sourceValue ) { if ( sourceValue == null ) { this.value = Variant.NULL; this.attributes = new HashMap<String, Variant> (); this.subscriptionState = SubscriptionState.DISCONNECTED; } else { this.value = sourceValue.getValue (); this.attributes = new HashMap<String, Variant> ( sourceValue.getAttributes () ); this.subscriptionState = sourceValue.getSubscriptionState (); this.subscriptionError = sourceValue.getSubscriptionError (); } }
public Builder ( final DataItemValue sourceValue ) { if ( sourceValue == null ) { this.value = Variant.NULL; this.attributes = new HashMap<String, Variant> (); this.subscriptionState = SubscriptionState.DISCONNECTED; } else { this.value = sourceValue.getValue (); this.attributes = new HashMap<String, Variant> ( sourceValue.getAttributes () ); this.subscriptionState = sourceValue.getSubscriptionState (); this.subscriptionError = sourceValue.getSubscriptionError (); } }
@Override protected void update () { if ( this.value == null ) { return; } if ( this.value.getSubscriptionError () == null ) { this.stateText.setText ( this.value.getSubscriptionState ().name () ); } else { this.stateText.setText ( String.format ( Messages.OverviewDetailsPart_SubscriptionStateFormat, this.value.getSubscriptionState ().name (), this.value.getSubscriptionError ().getMessage () ) ); } this.warnText.setText ( this.value.isWarning () ? Messages.OverviewDetailsPart_WarningActiveText : Messages.OverviewDetailsPart_WarningInactiveText ); this.alarmText.setText ( this.value.isAlarm () ? Messages.OverviewDetailsPart_AlarmActiveText : Messages.OverviewDetailsPart_AlarmInactiveText ); this.errorText.setText ( this.value.isError () ? Messages.OverviewDetailsPart_ErrorActiveText : Messages.OverviewDetailsPart_ErrorInactiveText ); this.manualText.setText ( this.value.isManual () ? Messages.OverviewDetailsPart_ManualActiveText : Messages.OverviewDetailsPart_ManualInactiveText ); this.blockedText.setText ( this.value.isBlocked () ? Messages.OverviewDetailsPart_BlockedActiveText : Messages.OverviewDetailsPart_BlockedInactiveText ); this.valueText.setText ( this.value.getValue () != null ? this.value.getValue ().toString () : Messages.OverviewDetailsPart_NullText ); final Calendar c = this.value.getTimestamp (); this.timestampText.setText ( c != null ? String.format ( Messages.OverviewDetailsPart_TimeFormat, c ) : Messages.OverviewDetailsPart_NullText ); } }
@Override protected void update () { if ( this.value == null ) { return; } if ( this.value.getSubscriptionError () == null ) { this.stateText.setText ( this.value.getSubscriptionState ().name () ); } else { this.stateText.setText ( String.format ( Messages.OverviewDetailsPart_SubscriptionStateFormat, this.value.getSubscriptionState ().name (), this.value.getSubscriptionError ().getMessage () ) ); } this.warnText.setText ( this.value.isWarning () ? Messages.OverviewDetailsPart_WarningActiveText : Messages.OverviewDetailsPart_WarningInactiveText ); this.alarmText.setText ( this.value.isAlarm () ? Messages.OverviewDetailsPart_AlarmActiveText : Messages.OverviewDetailsPart_AlarmInactiveText ); this.errorText.setText ( this.value.isError () ? Messages.OverviewDetailsPart_ErrorActiveText : Messages.OverviewDetailsPart_ErrorInactiveText ); this.manualText.setText ( this.value.isManual () ? Messages.OverviewDetailsPart_ManualActiveText : Messages.OverviewDetailsPart_ManualInactiveText ); this.blockedText.setText ( this.value.isBlocked () ? Messages.OverviewDetailsPart_BlockedActiveText : Messages.OverviewDetailsPart_BlockedInactiveText ); this.valueText.setText ( this.value.getValue () != null ? this.value.getValue ().toString () : Messages.OverviewDetailsPart_NullText ); final Calendar c = this.value.getTimestamp (); this.timestampText.setText ( c != null ? String.format ( Messages.OverviewDetailsPart_TimeFormat, c ) : Messages.OverviewDetailsPart_NullText ); } }