Class SourceInfo

java.lang.Object
co.permify.sdk.model.SourceInfo

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class SourceInfo extends Object
Source information collected at parse time.
  • Field Details

  • Constructor Details

    • SourceInfo

      public SourceInfo()
  • Method Details

    • syntaxVersion

      public SourceInfo syntaxVersion(String syntaxVersion)
    • getSyntaxVersion

      @Nullable public String getSyntaxVersion()
      The syntax version of the source, e.g. `cel1`.
      Returns:
      syntaxVersion
    • setSyntaxVersion

      public void setSyntaxVersion(String syntaxVersion)
    • location

      public SourceInfo location(String location)
    • getLocation

      @Nullable public String getLocation()
      The location name. All position information attached to an expression is relative to this location. The location could be a file, UI element, or similar. For example, `acme/app/AnvilPolicy.cel`.
      Returns:
      location
    • setLocation

      public void setLocation(String location)
    • lineOffsets

      public SourceInfo lineOffsets(List<Integer> lineOffsets)
    • addLineOffsetsItem

      public SourceInfo addLineOffsetsItem(Integer lineOffsetsItem)
    • getLineOffsets

      @Nullable public List<Integer> getLineOffsets()
      Monotonically increasing list of code point offsets where newlines `\\n` appear. The line number of a given position is the index `i` where for a given `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The column may be derivd from `id_positions[id] - line_offsets[i]`.
      Returns:
      lineOffsets
    • setLineOffsets

      public void setLineOffsets(List<Integer> lineOffsets)
    • positions

      public SourceInfo positions(Map<String,Integer> positions)
    • putPositionsItem

      public SourceInfo putPositionsItem(String key, Integer positionsItem)
    • getPositions

      @Nullable public Map<String,Integer> getPositions()
      A map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
      Returns:
      positions
    • setPositions

      public void setPositions(Map<String,Integer> positions)
    • macroCalls

      public SourceInfo macroCalls(Map<String,Expr> macroCalls)
    • putMacroCallsItem

      public SourceInfo putMacroCallsItem(String key, Expr macroCallsItem)
    • getMacroCalls

      @Nullable public Map<String,Expr> getMacroCalls()
      A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
      Returns:
      macroCalls
    • setMacroCalls

      public void setMacroCalls(Map<String,Expr> macroCalls)
    • equals

      public boolean equals(Object o)
      Return true if this SourceInfo object is equal to o.
      Overrides:
      equals in class Object
    • hashCode

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

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

      public String toUrlQueryString()
      Convert the instance into URL query string.
      Returns:
      URL query string
    • toUrlQueryString

      public String toUrlQueryString(String prefix)
      Convert the instance into URL query string.
      Parameters:
      prefix - prefix of the query string
      Returns:
      URL query string