Package org.postgresql.util
Class PGobject
- java.lang.Object
-
- org.postgresql.util.PGobject
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
PGbox,PGcircle,PGInterval,PGline,PGlseg,PGmoney,PGpath,PGpoint,PGpolygon
public class PGobject extends java.lang.Object implements java.io.Serializable, java.lang.CloneablePGobject is a class used to describe unknown types An unknown type is any type that is unknown by JDBC Standards.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PGobject()This is called by org.postgresql.Connection.getObject() to create the object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()This must be overridden to allow the object to be cloned.booleanequals(java.lang.Object obj)This must be overridden to allow comparisons of objects.protected static booleanequals(java.lang.Object a, java.lang.Object b)java.lang.StringgetType()As this cannot change during the life of the object, it's final.java.lang.StringgetValue()This must be overridden, to return the value of the object, in the form required by org.postgresql.inthashCode()Compute hash.booleanisNull()Returns true if the current object wraps `null` value.voidsetType(java.lang.String type)This method sets the type of this object.voidsetValue(java.lang.String value)This method sets the value of this object.java.lang.StringtoString()This is defined here, so user code need not override it.
-
-
-
Method Detail
-
setType
public final void setType(java.lang.String type)
This method sets the type of this object.It should not be extended by subclasses, hence it is final
- Parameters:
type- a string describing the type of the object
-
setValue
public void setValue(java.lang.String value) throws java.sql.SQLExceptionThis method sets the value of this object. It must be overridden.- Parameters:
value- a string representation of the value of the object- Throws:
java.sql.SQLException- thrown if value is invalid for this type
-
getType
public final java.lang.String getType()
As this cannot change during the life of the object, it's final.- Returns:
- the type name of this object
-
getValue
public java.lang.String getValue()
This must be overridden, to return the value of the object, in the form required by org.postgresql.- Returns:
- the value of this object
-
isNull
public boolean isNull()
Returns true if the current object wraps `null` value. This might be helpful- Returns:
- true if the current object wraps `null` value.
-
equals
public boolean equals(java.lang.Object obj)
This must be overridden to allow comparisons of objects.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- Object to compare with- Returns:
- true if the two boxes are identical
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionThis must be overridden to allow the object to be cloned.- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
This is defined here, so user code need not override it.- Overrides:
toStringin classjava.lang.Object- Returns:
- the value of this object, in the syntax expected by org.postgresql
-
hashCode
public int hashCode()
Compute hash. As equals() use only value. Return the same hash for the same value.- Overrides:
hashCodein classjava.lang.Object- Returns:
- Value hashcode, 0 if value is null
Objects.hashCode(Object)
-
equals
protected static boolean equals(java.lang.Object a, java.lang.Object b)
-
-