Class IntersectedPropertySet

    • Constructor Detail

      • IntersectedPropertySet

        public IntersectedPropertySet​(java.util.List<? extends PropertySet> propertySets)
    • Method Detail

      • refresh

        public void refresh()
        Recalculates the intersection. Should be called when underlying data changes. Modifications to the property sets through this class do not require refresh() to be called, they are tracked separately.
      • internalObjects

        protected java.util.List<? extends PropertySet> internalObjects()
      • iterator

        public java.util.Iterator<PropertyValue> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<PropertyValue>
      • get

        public <T> T get​(Property<T> prop)
        Returns the intersected value, or null if the values don't match or the property isn't present.
        Specified by:
        get in interface PropertyValueSource
      • getOrElse

        public <T> T getOrElse​(Property<T> prop,
                               T value)
        Description copied from interface: PropertyValueSource
        Get the value for a given Property, or else fall back to value if it's not present.
        Specified by:
        getOrElse in interface PropertyValueSource
        Parameters:
        prop - The Property for 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.
      • intersect

        protected <T> T intersect​(Property<T> prop,
                                  boolean orElse,
                                  T elseVal,
                                  T fallback)
      • isPropIntersectable

        protected <T> boolean isPropIntersectable​(Property<T> prop)
      • modifyPossibleProps

        protected void modifyPossibleProps​(Property<?> prop,
                                           boolean remove)
      • getValues

        public java.util.List<PropertyValue> getValues()
        Description copied from interface: PropertyValueSource
        Returns the opaque PropertyValue objects. This can be useful when you want to avoid the strict type checking of the value, and it's important to note that if the property is bound, the value will be a BoundValue. Be very careful about overriding, and make sure to maintain the methodology of using getProperties to iterate and get (or getOrDefault), to get the value, because those are all handled differently by BoundPropertySets, ExtendedPropertySets, etc.
        Specified by:
        getValues in interface PropertyValueSource
      • isExtended

        public boolean isExtended​(Property<?> prop)
        Description copied from interface: PropertySet
        Returns whether this property set contains a value for the prop, and the prop was actually inherited. In other words, this is true if the property is inherited, and an override value is present.
        Specified by:
        isExtended in interface PropertySet
      • isInherited

        public boolean isInherited​(Property<?> prop)
        Description copied from interface: PropertySet
        Indicates whether the property was inherited from a parent type.
        Specified by:
        isInherited in interface PropertySet
      • getIntersectableProperties

        protected java.util.Set<Property<?>> getIntersectableProperties()