Class PGHStore

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.String>

    public class PGHStore
    extends org.postgresql.util.PGobject
    implements java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.String>
    This implements a class that handles the PostgreSQL contrib/hstore type
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

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

      • Fields inherited from class org.postgresql.util.PGobject

        type, value
    • Constructor Summary

      Constructors 
      Constructor Description
      PGHStore()
      required by the driver
      PGHStore​(java.lang.String value)
      Initialize a hstore with a given string representation
      PGHStore​(java.util.Map<java.lang.String,​java.lang.String> map)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.String>> entrySet()  
      boolean equals​(java.lang.Object obj)
      Returns whether an object is equal to this one or not
      java.lang.String get​(java.lang.Object key)  
      java.lang.String getValue()
      Returns the stored information as a string
      int hashCode()  
      boolean isEmpty()  
      java.util.Set<java.lang.String> keySet()  
      java.lang.String put​(java.lang.String key, java.lang.String value)  
      void putAll​(java.util.Map<? extends java.lang.String,​? extends java.lang.String> m)  
      java.lang.String remove​(java.lang.Object key)  
      void setValue​(java.lang.String value)  
      void setValue​(java.util.Map<java.lang.String,​java.lang.String> map)  
      int size()  
      java.util.Collection<java.lang.String> values()  
      • Methods inherited from class org.postgresql.util.PGobject

        clone, getType, setType, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • PGHStore

        public PGHStore()
        required by the driver
      • PGHStore

        public PGHStore​(java.lang.String value)
                 throws java.sql.SQLException
        Initialize a hstore with a given string representation
        Parameters:
        value - String representated hstore
        Throws:
        java.sql.SQLException - Is thrown if the string representation has an unknown format
        See Also:
        setValue(String)
      • PGHStore

        public PGHStore​(java.util.Map<java.lang.String,​java.lang.String> map)
    • Method Detail

      • setValue

        public void setValue​(java.util.Map<java.lang.String,​java.lang.String> map)
      • setValue

        public void setValue​(java.lang.String value)
                      throws java.sql.SQLException
        Overrides:
        setValue in class org.postgresql.util.PGobject
        Throws:
        java.sql.SQLException
      • getValue

        public java.lang.String getValue()
        Returns the stored information as a string
        Overrides:
        getValue in class org.postgresql.util.PGobject
        Returns:
        String represented hstore
      • equals

        public boolean equals​(java.lang.Object obj)
        Returns whether an object is equal to this one or not
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.lang.String>
        Overrides:
        equals in class org.postgresql.util.PGobject
        Parameters:
        obj - Object to compare with
        Returns:
        true if the two hstores are identical
      • clear

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

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

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

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

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

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.lang.String>
        Overrides:
        hashCode in class org.postgresql.util.PGobject
      • isEmpty

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

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

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

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

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

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

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