com.m3.octoparts.ws.AggregateResponseEnrichment

RichAggregateResponse

implicit final class RichAggregateResponse extends AnyVal

Convenience methods to make it easier to work with com.m3.octoparts.model.AggregateResponse

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichAggregateResponse
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichAggregateResponse(aggResp: AggregateResponse)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. val aggResp: AggregateResponse

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  7. def getJsonPart[A](id: String, recoverWith: (String, Throwable) ⇒ Option[A] = warnFailure)(implicit arg0: Reads[A]): Option[A]

    Extracts the part with the given ID from the Octoparts response and deserializes its JSON content to an A.

    Extracts the part with the given ID from the Octoparts response and deserializes its JSON content to an A.

    Note that an appropriate play.api.libs.json.Reads must be available in implicit scope.

    Will return None if: - a part with the given ID is not present in the response - the part has no content - the JSON parsing fails (e.g. the content is not JSON, or the JSON is broken in some way) - the JSON deserialization fails (i.e. the JSON is valid, but cannot be deserialized into an A)

    Note: - The method does not check the status code of the response or the presence of error messages.

    A

    the result type, i.e. the type of the JSON-serialized object

    id

    the part request unique id (or partId if the part request did not specify an ID)

    recoverWith

    can be customized to return something even if JSON extraction failed.

    returns

    the object, or None if it could not be found and deserialized for some reason.

  8. def getJsonPartOrElse[A](id: String, default: ⇒ A)(implicit arg0: Reads[A]): A

  9. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  10. def toString(): String

    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped