com.google.web.bindery.requestfactory.server

## Class Resolver

- java.lang.Object
- - com.google.web.bindery.requestfactory.server.Resolver

-      class Resolver
      extends java.lang.Object

  Responsible for converting between domain and client entities. This class has a small amount of temporary state used to handle graph cycles and assignment of synthetic ids.
  See Also:
    `RequestState.getResolver()`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Resolver(RequestState state)` Should only be called from `RequestState`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) static int` | `index(java.lang.String path)` Returns the trailing `[n]` index value from a path.
    `(package private) static boolean` | `matchesPropertyRef(java.util.Set<java.lang.String> propertyRefs, java.lang.String newPrefix)` Returns `true` if the given prefix is one of the requested property references.
    `java.lang.Object` | `resolveClientValue(java.lang.Object domainValue, java.lang.reflect.Type assignableTo, java.util.Set<java.lang.String> propertyRefs)` Given a domain object, return a value that can be encoded by the client.
    `java.lang.Object` | `resolveDomainValue(java.lang.Object maybeEntityProxy, boolean detectDeadEntities)` Convert a client-side value into a domain value.
    `(package private) static java.lang.String` | `snipIndex(java.lang.String path)` Removes the trailing `[n]` from a path.

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

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

- - ### Constructor Detail

    - #### Resolver

          Resolver(RequestState state)

      Should only be called from `RequestState`.

  - ### Method Detail

    - #### index

          static int index(java.lang.String path)

      Returns the trailing `[n]` index value from a path.

    - #### matchesPropertyRef

          static boolean matchesPropertyRef(java.util.Set<java.lang.String> propertyRefs,
                                   java.lang.String newPrefix)

      Returns `true` if the given prefix is one of the requested property references.

    - #### snipIndex

          static java.lang.String snipIndex(java.lang.String path)

      Removes the trailing `[n]` from a path.

    - #### resolveClientValue

          public java.lang.Object resolveClientValue(java.lang.Object domainValue,
                                            java.lang.reflect.Type assignableTo,
                                            java.util.Set<java.lang.String> propertyRefs)

      Given a domain object, return a value that can be encoded by the client.
      Parameters:
        `domainValue` - the domain object to be converted into a client-side value
        `assignableTo` - the type in the client to which the resolved value should be assignable. A value of `null` indicates that any resolution will suffice.
        `propertyRefs` - the property references requested by the client

    - #### resolveDomainValue

          public java.lang.Object resolveDomainValue(java.lang.Object maybeEntityProxy,
                                            boolean detectDeadEntities)

      Convert a client-side value into a domain value.
      Parameters:
        `maybeEntityProxy` - the client object to resolve
        `detectDeadEntities` - if `true` this method will throw a ReportableException containing a `DeadEntityException` if an EntityProxy cannot be resolved