Class Ref<T extends software.amazon.smithy.model.node.ToNode>

java.lang.Object
software.amazon.smithy.openapi.model.Ref<T>
All Implemented Interfaces:
software.amazon.smithy.model.node.ToNode

public abstract class Ref<T extends software.amazon.smithy.model.node.ToNode> extends Object implements software.amazon.smithy.model.node.ToNode
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ref()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract T
    deref(ComponentsObject components)
    Dereferences the value stored in a ref.
    abstract Optional<String>
    Gets the JSON pointer to the component.
    static <T extends software.amazon.smithy.model.node.ToNode>
    Ref<T>
    local(T value)
    Creates a local ref to a value that is inlined.
    static <T extends software.amazon.smithy.model.node.ToNode>
    Ref<T>
    remote(String pointer)
    Creates a remote reference using a JSON pointer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.smithy.model.node.ToNode

    toNode
  • Constructor Details

    • Ref

      public Ref()
  • Method Details

    • deref

      public abstract T deref(ComponentsObject components)
      Dereferences the value stored in a ref.
      Parameters:
      components - Components object to query for pointers.
      Returns:
      Returns the dereferenced value.
    • getPointer

      public abstract Optional<String> getPointer()
      Gets the JSON pointer to the component.

      The return value is empty if this is an inline component.

      Returns:
      Returns the optional pointer.
    • remote

      public static <T extends software.amazon.smithy.model.node.ToNode> Ref<T> remote(String pointer)
      Creates a remote reference using a JSON pointer.
      Type Parameters:
      T - Type of value being created.
      Parameters:
      pointer - Pointer to the actual value.
      Returns:
      Returns the created Ref.
    • local

      public static <T extends software.amazon.smithy.model.node.ToNode> Ref<T> local(T value)
      Creates a local ref to a value that is inlined.
      Type Parameters:
      T - Type of value that is inlined.
      Parameters:
      value - Inline value.
      Returns:
      Returns the created Ref.