Class JoinableMap

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JoinableMap.GroupableSet
      This private class is only to knows if the set implementation into the groupable object is because the groupable object was grouped whit other instance or the set is domains information.
      static class  JoinableMap.JoinableEntry<K,​V>  
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      JoinableMap()  
      JoinableMap​(java.lang.String resourceName)  
      JoinableMap​(java.util.Map<java.lang.String,​java.lang.Object> mapInstance, java.lang.String... fields)  
    • Method Summary

      Modifier and Type Method Description
      void clear()
      Remove all the elements of the groupable object.
      Enlarged clone​(java.lang.String... fields)
      Clone the joinable map instance.
      Enlarged cloneEmpty()
      Clone the joinable map without domain information.
      java.lang.Object compute​(java.lang.String key, java.util.function.BiFunction<? super java.lang.String,​? super java.lang.Object,​?> remappingFunction)  
      java.lang.Object computeIfAbsent​(java.lang.String key, java.util.function.Function<? super java.lang.String,​?> mappingFunction)  
      java.lang.Object computeIfPresent​(java.lang.String key, java.util.function.BiFunction<? super java.lang.String,​? super java.lang.Object,​?> remappingFunction)  
      boolean containsKey​(java.lang.Object key)  
      boolean containsResource​(java.lang.String resourceName)
      Verify if the joinable map instance contains a specific resource.
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.Object>> entrySet()  
      boolean equals​(java.lang.Object o)  
      void forEach​(java.util.function.BiConsumer<? super java.lang.String,​? super java.lang.Object> action)  
      java.lang.Object get​(java.lang.Object key)  
      java.lang.Object get​(java.lang.String fieldName)
      Return the value of the field name.
      java.lang.Object getOrDefault​(java.lang.Object key, java.lang.Object defaultValue)  
      java.util.Map<java.lang.String,​java.lang.Object> getResourceModel​(java.lang.String resourceName)
      Returns a part of the model that represents a specific resource.
      java.util.Set<java.lang.String> getResources()
      Returns the set of resources.
      Groupable group​(Groupable groupable)
      Group this instance with the parameter instance.
      int hashCode()  
      boolean isEmpty()  
      Joinable join​(java.lang.String leftResource, java.lang.String rightResource, Joinable joinable)
      Join the information stored into this instance of the joinable with the informacion stored into the joinable parameter.
      java.util.Set<java.lang.String> keySet()
      Returns all the labels into the groupable instance.
      java.lang.Object merge​(java.lang.String key, java.lang.Object value, java.util.function.BiFunction<? super java.lang.Object,​? super java.lang.Object,​?> remappingFunction)  
      <P extends BsonParcelable>
      P
      populate​(org.hcjf.bson.BsonDocument document)
      This method populate the joinable map with the information into the bson document.
      void purge()
      This method remove all the fields that it's not static
      java.lang.Object put​(java.lang.String key, java.lang.Object value)
      Add a new value to the instance.
      void putAll​(java.util.Map<? extends java.lang.String,​?> m)  
      java.lang.Object putIfAbsent​(java.lang.String key, java.lang.Object value)  
      java.lang.Object remove​(java.lang.Object key)  
      boolean remove​(java.lang.Object key, java.lang.Object value)  
      java.lang.Object replace​(java.lang.String key, java.lang.Object value)  
      boolean replace​(java.lang.String key, java.lang.Object oldValue, java.lang.Object newValue)  
      void replaceAll​(java.util.function.BiFunction<? super java.lang.String,​? super java.lang.Object,​?> function)  
      void setResource​(java.lang.String resourceName)  
      int size()  
      org.hcjf.bson.BsonDocument toBson()
      Creates a bson document from the JoinableMap instance.
      java.lang.String toString()
      Write all the elements of the map.
      java.util.Collection<java.lang.Object> values()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JoinableMap

        public JoinableMap()
      • JoinableMap

        public JoinableMap​(java.lang.String resourceName)
      • JoinableMap

        public JoinableMap​(java.util.Map<java.lang.String,​java.lang.Object> mapInstance,
                           java.lang.String... fields)
    • Method Detail

      • toBson

        public org.hcjf.bson.BsonDocument toBson()
        Creates a bson document from the JoinableMap instance.
        Specified by:
        toBson in interface BsonParcelable
        Returns:
        Bson document instance.
      • populate

        public <P extends BsonParcelable> P populate​(org.hcjf.bson.BsonDocument document)
        This method populate the joinable map with the information into the bson document.
        Specified by:
        populate in interface BsonParcelable
        Type Parameters:
        P - Expected BsonParcelable data type.
        Parameters:
        document - Bson document to populate the parcelable.
        Returns:
        Returns the bson parcelable instance.
      • purge

        public void purge()
        This method remove all the fields that it's not static
        Specified by:
        purge in interface Enlarged
      • clone

        public Enlarged clone​(java.lang.String... fields)
        Clone the joinable map instance.
        Specified by:
        clone in interface Enlarged
        Parameters:
        fields - Array of static fields
        Returns:
        Joinalbe map clone.
      • cloneEmpty

        public Enlarged cloneEmpty()
        Clone the joinable map without domain information.
        Specified by:
        cloneEmpty in interface Enlarged
        Returns:
        Joinable map clone.
      • get

        public java.lang.Object get​(java.lang.String fieldName)
        Return the value of the field name.
        Specified by:
        get in interface Enlarged
        Specified by:
        get in interface Groupable
        Specified by:
        get in interface Joinable
        Parameters:
        fieldName - Field name.
        Returns:
        Value of the field.
      • setResource

        public void setResource​(java.lang.String resourceName)
      • join

        public Joinable join​(java.lang.String leftResource,
                             java.lang.String rightResource,
                             Joinable joinable)
        Join the information stored into this instance of the joinable with the informacion stored into the joinable parameter.
        Specified by:
        join in interface Joinable
        Parameters:
        leftResource - Name of the left resource of the join.
        rightResource - Name of the right resource of the join.
        joinable - Joinable parameter.
        Returns:
        Return this instance of the joinable.
        Throws:
        java.lang.IllegalArgumentException - if the joinable parameter is not a JoinableMap instance.
        java.lang.NullPointerException - if the joinable parameter is null.
      • containsResource

        public boolean containsResource​(java.lang.String resourceName)
        Verify if the joinable map instance contains a specific resource.
        Parameters:
        resourceName - Resource name
        Returns:
        Return true of the resource is present into the instance nad false in the otherwise.
      • getResourceModel

        public java.util.Map<java.lang.String,​java.lang.Object> getResourceModel​(java.lang.String resourceName)
        Returns a part of the model that represents a specific resource.
        Parameters:
        resourceName - Resource name.
        Returns:
        Part of the model.
      • getResources

        public java.util.Set<java.lang.String> getResources()
        Returns the set of resources.
        Returns:
        Set of resources.
      • group

        public Groupable group​(Groupable groupable)
        Description copied from interface: Groupable
        Group this instance with the parameter instance.
        Specified by:
        group in interface Groupable
        Parameters:
        groupable - Other instance to group.
        Returns:
        Return this instance grouped.
      • toString

        public final java.lang.String toString()
        Write all the elements of the map.
        Overrides:
        toString in class java.lang.Object
        Returns:
        Map print.
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​java.lang.Object>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<java.lang.String,​java.lang.Object>
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.lang.Object>
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        Description copied from interface: Enlarged
        Add a new value to the instance.
        Specified by:
        put in interface Enlarged
        Specified by:
        put in interface java.util.Map<java.lang.String,​java.lang.Object>
        Parameters:
        key - Name of the value.
        value - Value instance.
        Returns:
        Return the value added.
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
      • putAll

        public void putAll​(java.util.Map<? extends java.lang.String,​?> m)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​java.lang.Object>
      • clear

        public void clear()
        Description copied from interface: Groupable
        Remove all the elements of the groupable object.
        Specified by:
        clear in interface Groupable
        Specified by:
        clear in interface java.util.Map<java.lang.String,​java.lang.Object>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Description copied from interface: Groupable
        Returns all the labels into the groupable instance.
        Specified by:
        keySet in interface Enlarged
        Specified by:
        keySet in interface Groupable
        Specified by:
        keySet in interface java.util.Map<java.lang.String,​java.lang.Object>
        Returns:
        Set with all the labels.
      • values

        public java.util.Collection<java.lang.Object> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​java.lang.Object>
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.Object>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​java.lang.Object>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        hashCode in class java.lang.Object
      • getOrDefault

        public java.lang.Object getOrDefault​(java.lang.Object key,
                                             java.lang.Object defaultValue)
        Specified by:
        getOrDefault in interface java.util.Map<java.lang.String,​java.lang.Object>
      • forEach

        public void forEach​(java.util.function.BiConsumer<? super java.lang.String,​? super java.lang.Object> action)
        Specified by:
        forEach in interface java.util.Map<java.lang.String,​java.lang.Object>
      • replaceAll

        public void replaceAll​(java.util.function.BiFunction<? super java.lang.String,​? super java.lang.Object,​?> function)
        Specified by:
        replaceAll in interface java.util.Map<java.lang.String,​java.lang.Object>
      • putIfAbsent

        public java.lang.Object putIfAbsent​(java.lang.String key,
                                            java.lang.Object value)
        Specified by:
        putIfAbsent in interface java.util.Map<java.lang.String,​java.lang.Object>
      • remove

        public boolean remove​(java.lang.Object key,
                              java.lang.Object value)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
      • replace

        public boolean replace​(java.lang.String key,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
        Specified by:
        replace in interface java.util.Map<java.lang.String,​java.lang.Object>
      • replace

        public java.lang.Object replace​(java.lang.String key,
                                        java.lang.Object value)
        Specified by:
        replace in interface java.util.Map<java.lang.String,​java.lang.Object>
      • computeIfAbsent

        public java.lang.Object computeIfAbsent​(java.lang.String key,
                                                java.util.function.Function<? super java.lang.String,​?> mappingFunction)
        Specified by:
        computeIfAbsent in interface java.util.Map<java.lang.String,​java.lang.Object>
      • computeIfPresent

        public java.lang.Object computeIfPresent​(java.lang.String key,
                                                 java.util.function.BiFunction<? super java.lang.String,​? super java.lang.Object,​?> remappingFunction)
        Specified by:
        computeIfPresent in interface java.util.Map<java.lang.String,​java.lang.Object>
      • compute

        public java.lang.Object compute​(java.lang.String key,
                                        java.util.function.BiFunction<? super java.lang.String,​? super java.lang.Object,​?> remappingFunction)
        Specified by:
        compute in interface java.util.Map<java.lang.String,​java.lang.Object>
      • merge

        public java.lang.Object merge​(java.lang.String key,
                                      java.lang.Object value,
                                      java.util.function.BiFunction<? super java.lang.Object,​? super java.lang.Object,​?> remappingFunction)
        Specified by:
        merge in interface java.util.Map<java.lang.String,​java.lang.Object>