Interface PropertyValueSource
-
- All Known Subinterfaces:
AlarmDefinition,AlarmEvent,AuthenticatedUser,BoundPropertySet,MutablePropertyValueSource,NotificationContext,ObservablePropertySet,ObservablePropertySource,PropertySet,PropertySetEdit,QualifiedValuePropertySet,QualifiedValuePropertySource,TagConfiguration,TagConfigurationModel,TagEditController<T>,TagGroup,User,VersionedPropertySet
- All Known Implementing Classes:
AbstractExtendedPropertySet,ADSSOAuthChallenge,AlarmDefinitionConfig,AlarmDefinitionDiff,AlarmEventInstance,AuthChallenge,BasicAlarmDefinition,BasicAlarmEvent,BasicAuthChallenge,BasicAuthenticatedUser,BasicBoundPropertySet,BasicPropertySet,BasicTagConfiguration,BasicTagConfigurationModel,BasicTagEditController,BasicUser,BasicVersionedPropertySet,BoundExtendedPropertySet,BoundPropertySetConfig,BoundPropertySetDiff,ChartUIElement,ComplexTagDefinition,ComplexTagDiff,CompositePropertySet,DelegatePropertySet,EventData,ExtendedAlarmDefinition,ExtendedPropertySet,IdentityTraits,ImmutablePropertySet,IntersectedAlarmDefinition,IntersectedBoundPropertySet,IntersectedPropertySet,IntersectedTagConfig,IntersectedTagEditModel,PipelineDescriptor,PropertySetConfig,PropertySetDiff,PyAlarmEventImpl,PyUser,StorageTagConfiguration,TagDefinition,TagDiff,TagEditResources,TagPropertySetWrapper
public interface PropertyValueSourceThis interface represents a specific subset of functionality implemented by most property holders (such asPropertySet), used to retrieve property values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontains(Property<?> prop)<T> Tget(Property<T> prop)Retrieves the value of the property, or null if this set doesn't contain that property.default <T> TgetNonNull(Property<T> prop, java.util.function.Supplier<T> supplier)The value for prop if it exists and is not null.default <T> TgetNonNull(Property<T> prop, T value)The value for prop if it exists and is not null.<T> TgetOrDefault(Property<T> prop)<T> TgetOrElse(Property<T> prop, T value)Get the value for a givenProperty, or else fall back to value if it's not present.java.util.Collection<Property<?>>getProperties()default java.util.List<PropertyValue>getValues()
-
-
-
Method Detail
-
getProperties
java.util.Collection<Property<?>> getProperties()
-
getValues
default java.util.List<PropertyValue> getValues()
-
get
@Nullable <T> T get(Property<T> prop)
Retrieves the value of the property, or null if this set doesn't contain that property.
-
contains
boolean contains(Property<?> prop)
- Returns:
- True if the source contains a value for prop.
-
getOrDefault
@Nullable <T> T getOrDefault(Property<T> prop)
- Returns:
- The value for prop or
Property.getDefaultValue()if not present. Can return null if the value is null.
-
getOrElse
@Nullable <T> T getOrElse(Property<T> prop, T value)
Get the value for a givenProperty, or else fall back to value if it's not present.- Parameters:
prop- ThePropertyfor which a value is to be retrieved.value- The value to default to if property isn't present.- Returns:
- The value of property if present, value if not. Can return null if the value is null.
-
getNonNull
@Nonnull default <T> T getNonNull(Property<T> prop, @Nonnull T value)
The value for prop if it exists and is not null. Otherwise returnsProperty.getDefaultValue()if that exists and is not null. Finally will fallback to value.- Parameters:
prop- ThePropertyfor which a value is to be retrieved.value- The value to default to if property isn't present or returns null and has no default.- Returns:
- The value of property if present and non-null, otherwise
Property.getDefaultValue()if non-null, otherwise value if neither is present and non-null
-
getNonNull
@Nonnull default <T> T getNonNull(Property<T> prop, @Nonnull java.util.function.Supplier<T> supplier)
The value for prop if it exists and is not null. Otherwise returnsProperty.getDefaultValue()if that exists and is not null. Finally will fallback to value.- Parameters:
prop- ThePropertyfor which a value is to be retrieved.supplier- The supplier of a default value to use if property isn't present or returns null and has no default. Supplier must not return null.- Returns:
- The value of property if present and non-null, otherwise
Property.getDefaultValue()if non-null, otherwise value if neither is present and non-null
-
-