AGRepositoryConnection.AttributeDefinition (agraph-java-client 5.0.4-SNAPSHOT API)
Description: declaration: package: com.franz.agraph.repository, class: AGRepositoryConnection, class: AttributeDefinition

Package com.franz.agraph.repository

# Class AGRepositoryConnection.AttributeDefinition

java.lang.Object
com.franz.agraph.repository.AGRepositoryConnection.AttributeDefinition

Enclosing class:
  `AGRepositoryConnection`

public class AGRepositoryConnection.AttributeDefinition extends Object
Builder class for defining a new attribute definition. After instantiation, use the setter methods to build up the attribute definition. The `add` method will submit the definition to AG.

The object can be discarded once `add` is called.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AttributeDefinition(String name)`
  To define an attribute, use `AGRepositoryConnection.defineAttribute(String)` instead of calling the constructor directly.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AGRepositoryConnection.AttributeDefinition`
  `add()`
  Pass the current attribute definition to AllegroGraph for defining.
  `AGRepositoryConnection.AttributeDefinition`
  `allowedValue(String value)`
  Add an allowed value to the current list of allowed values for this attribute definition
  `AGRepositoryConnection.AttributeDefinition`
  `allowedValues(List<String> values)`
  Overwrite current setting of allowedValues with the argument List.
  `AGRepositoryConnection.AttributeDefinition`
  `maximum(long value)`
  The maximum number of times this attribute can be provided with a triple.
  `AGRepositoryConnection.AttributeDefinition`
  `minimum(long value)`
  The minimum number of times this attribute must be provided for a triple.
  `AGRepositoryConnection.AttributeDefinition`
  `ordered(boolean value)`
  Specifies whether the values allowed by this attribute definition are ordered.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AttributeDefinition

    public AttributeDefinition(String name)
    To define an attribute, use `AGRepositoryConnection.defineAttribute(String)` instead of calling the constructor directly.
    Parameters:
      `name` - of the attribute

- ## Method Details

  - ### allowedValues

    public AGRepositoryConnection.AttributeDefinition allowedValues(List<String> values)
    Overwrite current setting of allowedValues with the argument List.
    Parameters:
      `values` - , a `List<String>` of allowed values
    Returns:
      this

  - ### allowedValue

    public AGRepositoryConnection.AttributeDefinition allowedValue(String value)
    Add an allowed value to the current list of allowed values for this attribute definition
    Parameters:
      `value` - an allowed value for this attribute
    Returns:
      this

  - ### ordered

    public AGRepositoryConnection.AttributeDefinition ordered(boolean value)
    Specifies whether the values allowed by this attribute definition are ordered.
    Parameters:
      `value` - boolean, if this attribute is ordered
    Returns:
      this

  - ### minimum

    public AGRepositoryConnection.AttributeDefinition minimum(long value) throws Exception
    The minimum number of times this attribute must be provided for a triple.
    Parameters:
      `value` - , the minimum number of times this attribute can be specified
    Returns:
      this
    Throws:
      `Exception` - if `value` is invalid

  - ### maximum

    public AGRepositoryConnection.AttributeDefinition maximum(long value) throws Exception
    The maximum number of times this attribute can be provided with a triple.
    Parameters:
      `value` - the maximum number of times this attribute can be specified
    Returns:
      this
    Throws:
      `Exception` - if `value` is invalid

  - ### add

    public AGRepositoryConnection.AttributeDefinition add() throws AGHttpException
    Pass the current attribute definition to AllegroGraph for defining.
    Returns:
      this
    Throws:
      `AGHttpException` - if there is an error with the request