Top Description Fields Constructors Methods
org.postgresql.util

public Class PGobject

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
org.postgresql.geometric.PGbox, org.postgresql.geometric.PGcircle, org.postgresql.geometric.PGline, org.postgresql.geometric.PGlseg, org.postgresql.geometric.PGpath, org.postgresql.geometric.PGpoint, org.postgresql.geometric.PGpolygon, org.postgresql.jdbc.PgResultSet.NullObject, org.postgresql.util.PGInterval, org.postgresql.util.PGmoney
Static Imports
org.postgresql.util.internal.Nullness.castNonNull

PGobject is a class used to describe unknown types An unknown type is any type that is unknown by JDBC Standards.

Field Summary

Modifier and TypeField and Description
protected @Nullable String
protected @Nullable String

Constructor Summary

AccessConstructor and Description
public
PGobject()

This is called by org.postgresql.Connection.getObject() to create the object.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

This must be overridden to allow the object to be cloned.

public boolean

Returns:

true if the two boxes are identical
equals
(@Nullable Object
Object to compare with
obj
)

Overrides java.lang.Object.equals.

This must be overridden to allow comparisons of objects.

protected static boolean
public final String

Returns:

the type name of this object
getType
()

As this cannot change during the life of the object, it's final.

public @Nullable String

Returns:

the value of this object
getValue
()

This must be overridden, to return the value of the object, in the form required by org.postgresql.

public int

Returns:

Value hashcode, 0 if value is null java.util.Objects#hashCode(Object)
hashCode
()

Overrides java.lang.Object.hashCode.

Compute hash.

public boolean

Returns:

true if the current object wraps `null` value.
isNull
()

Returns true if the current object wraps `null` value.

public final void
setType(String
a string describing the type of the object
type
)

This method sets the type of this object.

public void
setValue(@Nullable String
a string representation of the value of the object
value
)

This method sets the value of this object.

public String

Returns:

the value of this object, in the syntax expected by org.postgresql
toString
()

Overrides java.lang.Object.toString.

This is defined here, so user code need not override it.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

typeback to summary
protected @Nullable String type
valueback to summary
protected @Nullable String value

Constructor Detail

PGobjectback to summary
public PGobject()

This is called by org.postgresql.Connection.getObject() to create the object.

Method Detail

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

This must be overridden to allow the object to be cloned.

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

equalsback to summary
public boolean equals(@Nullable Object obj)

Overrides java.lang.Object.equals.

This must be overridden to allow comparisons of objects.

Parameters
obj:@Nullable Object

Object to compare with

Returns:boolean

true if the two boxes are identical

Annotations
@Override
equalsback to summary
protected static boolean equals(@Nullable Object a, @Nullable Object b)
getTypeback to summary
public final String getType()

As this cannot change during the life of the object, it's final.

Returns:String

the type name of this object

getValueback to summary
public @Nullable String getValue()

This must be overridden, to return the value of the object, in the form required by org.postgresql.

Returns:@Nullable String

the value of this object

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Compute hash. As equals() use only value. Return the same hash for the same value.

Returns:int

Value hashcode, 0 if value is null java.util.Objects#hashCode(Object)

Annotations
@Override
isNullback to summary
public boolean isNull()

Returns true if the current object wraps `null` value. This might be helpful

Returns:boolean

true if the current object wraps `null` value.

setTypeback to summary
public final void setType(String type)

This method sets the type of this object.

It should not be extended by subclasses, hence it is final

Parameters
type:String

a string describing the type of the object

setValueback to summary
public void setValue(@Nullable String value) throws SQLException

This method sets the value of this object. It must be overridden.

Parameters
value:@Nullable String

a string representation of the value of the object

Exceptions
SQLException:
thrown if value is invalid for this type
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

This is defined here, so user code need not override it.

Returns:String

the value of this object, in the syntax expected by org.postgresql

Annotations
@Override
@SuppressWarnings:nullness