Class StoredFunction

java.lang.Object
io.github.mfvanek.pg.model.function.StoredFunction
All Implemented Interfaces:
DbObject, Comparable<StoredFunction>

public final class StoredFunction extends Object implements DbObject, Comparable<StoredFunction>
A representation of any stored procedure/function.
Since:
0.7.0
  • Field Details

    • FUNCTION_NAME_FIELD

      public static final String FUNCTION_NAME_FIELD
      Constant representing the field name for a stored procedure or function name within the StoredFunction class.
      See Also:
    • FUNCTION_SIGNATURE_FIELD

      public static final String FUNCTION_SIGNATURE_FIELD
      Constant representing the field name for a function's signature.
      See Also:
  • Method Details

    • getName

      public String getName()
      Retrieves database object name.
      Specified by:
      getName in interface DbObject
      Returns:
      database object name
    • getObjectType

      public PgObjectType getObjectType()
      Retrieves database object type.
      Specified by:
      getObjectType in interface DbObject
      Returns:
      database object type
    • getFunctionName

      public String getFunctionName()
      Retrieves procedure/function name.
      Returns:
      returns procedure/function name
    • getFunctionSignature

      public String getFunctionSignature()
      Retrieves procedure/function arguments.
      Returns:
      returns procedure/function arguments or empty string
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(StoredFunction other)
      Specified by:
      compareTo in interface Comparable<StoredFunction>
    • ofNoArgs

      public static StoredFunction ofNoArgs(String functionName)
      Constructs a StoredFunction object without arguments/signature.
      Parameters:
      functionName - procedure/function name.
      Returns:
      StoredFunction
    • ofNoArgs

      public static StoredFunction ofNoArgs(PgContext pgContext, String functionName)
      Constructs a StoredFunction object without arguments/signature with given context.
      Parameters:
      pgContext - the schema context to enrich procedure/function name; must be non-null.
      functionName - procedure/function name.
      Returns:
      StoredFunction
      Since:
      0.14.3
    • of

      public static StoredFunction of(String functionName, String functionSignature)
      Constructs a StoredFunction object.
      Parameters:
      functionName - procedure/function name.
      functionSignature - procedure/function signature (arguments).
      Returns:
      StoredFunction
    • of

      public static StoredFunction of(PgContext pgContext, String functionName, String functionSignature)
      Constructs a StoredFunction object with given context.
      Parameters:
      pgContext - the schema context to enrich procedure/function name; must be non-null.
      functionName - procedure/function name.
      functionSignature - procedure/function signature (arguments).
      Returns:
      StoredFunction
      Since:
      0.14.3