org.specs2.form

Prop

case class Prop[T, S](label: String = "", actual: Property[T] = control.Property.apply[T](), expected: Property[S] = control.Property.apply[S](), constraint: (T, S) ⇒ Result = Prop.checkProp[Any, Nothing], decorator: Decorator = ...) extends Executable with DecoratedProperty[Prop[T, S]] with Product with Serializable

The Prop class is a named property which holds:

This property can be executed and can be inserted in a Form.

A Prop is meant to be declared as "bound" to an actual value:

val customerName = Prop("Customer name", person.name)

[the actual value is not evaluated until the Prop is executed]

Then it can be associated an expected value with the apply method (usually in a Form declaration):

customerName("Bill")

The actual and the expected values can have different types and the constraint which is applied to them can be anything returning a result.

However the Prop companion object provides a method to create a Property with a constraint using a beEqualTo matcher:

Prop("Name", "Eric")("Eric") must_== Success("'Eric' is equal to 'Eric'")

Linear Supertypes
Serializable, Serializable, Product, Equals, DecoratedProperty[Prop[T, S]], DecoratedLabel[Prop[T, S]], Executable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Prop
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. DecoratedProperty
  7. DecoratedLabel
  8. Executable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Prop(label: String = "", actual: Property[T] = control.Property.apply[T](), expected: Property[S] = control.Property.apply[S](), constraint: (T, S) ⇒ Result = Prop.checkProp[Any, Nothing], decorator: Decorator = ...)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

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

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  6. val actual: Property[T]

  7. lazy val actualValue: Product with Serializable with Either[Result, T]

    returns

    the actual value as either Right(value) or Left(result)

  8. def apply(e: ⇒ S): Prop[T, S]

    The apply method sets the expected value and returns the Prop

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. val constraint: (T, S) ⇒ Result

  12. def decorateLabel(ns: Any): Any

    do the decoration

    do the decoration

    Definition Classes
    DecoratedLabel
  13. def decorateLabelWith(f: (Any) ⇒ Any): Prop[T, S]

    set a new Decorator for the label

    set a new Decorator for the label

    Definition Classes
    DecoratedLabel
  14. def decorateValue(ns: Any): Any

    do the decoration

    do the decoration

    Definition Classes
    DecoratedProperty
  15. def decorateValueWith(f: (Any) ⇒ Any): Prop[T, S]

    set a new Decorator for the value

    set a new Decorator for the value

    Definition Classes
    DecoratedProperty
  16. def decorateWith(f: (Any) ⇒ Any): Prop[T, S]

    set a new Decorator

    set a new Decorator

    Definition Classes
    DecoratedProperty
  17. val decorator: Decorator

    Definition Classes
    PropDecoratedLabel
  18. def decoratorIs(d: Decorator): Prop[T, S]

    set a new Decorator

    set a new Decorator

    Definition Classes
    PropDecoratedLabel
  19. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. def equals(a: Any): Boolean

    Definition Classes
    Prop → Equals → AnyRef → Any
  21. def execute: Result

    execute the constraint set on this property, with the expected value

    execute the constraint set on this property, with the expected value

    Definition Classes
    Prop → Executable
  22. val expected: Property[S]

  23. lazy val expectedValue: Product with Serializable with Either[Result, S]

    returns

    the expected value as an option

  24. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def get: S

    shortcut method for this().

    shortcut method for this().get returning the contained expected value.

    returns

    the expected value if set and throws an exception otherwise

  26. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Definition Classes
    Prop → AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. val label: String

  30. def labelStyles: String

    return the label styles

    return the label styles

    Definition Classes
    DecoratedLabel
  31. def map(f: (Result) ⇒ Result): Executable

    Definition Classes
    Executable
  32. def matchWith(c: (T, S) ⇒ Result): Prop[T, S]

    set a specific constraint on the property

  33. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  36. def resultIs(r: ⇒ Result): Prop[T, S]

    set a specific result on the property

  37. def styleLabelWith(s: (String, String)): Prop[T, S]

    set a new style for the label

    set a new style for the label

    Definition Classes
    DecoratedLabel
  38. def styleValueWith(s: (String, String)): Prop[T, S]

    set a new style for the value

    set a new style for the value

    Definition Classes
    DecoratedProperty
  39. def styleWith(s: (String, String)): Prop[T, S]

    set a new style

    set a new style

    Definition Classes
    DecoratedProperty
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  41. def toString(): String

    Display the property:

    Display the property:

    label: "this" (actual: "that")

    Definition Classes
    Prop → AnyRef → Any
  42. def valueStyles: String

    Definition Classes
    DecoratedProperty
  43. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from DecoratedProperty[Prop[T, S]]

Inherited from DecoratedLabel[Prop[T, S]]

Inherited from Executable

Inherited from AnyRef

Inherited from Any

Ungrouped