object Case
Factory object for creating Cases.
- Alphabetic
- By Inheritance
- Case
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[Before <: Context, After <: Context, Value, Input](context: Before, after: After)(conversion: (Value) ⇒ Input): Case[(Before, After), Value, Input]
Creates a new Case for instances of type
Value
, specifying thecontext
in which that type may be substituted, andafter
context.Creates a new Case for instances of type
Value
, specifying thecontext
in which that type may be substituted, andafter
context.For example, the case defined by,
Case(Param, AfterParam) { (p: Int) => s"'$p'" }
handles substitutions at a hole with a hypothetical
Param
Context of integer values, converting them to a string by wrapping them in single-quotes, and specifying the hypotheticalAfterParam
Context for the continuation of parsing, following the substitution.For any Interpolator which parses the interpolated string, allows substitutions, and uses multiple Contexts, the
after
value is important in determining how making the substitution changes the parse context. For example, considering the hole in,json"""{ "key": $value }"""
prior to the substitution of
value
, the Context would be a value representing a position where any JSON value may be substituted, but following the substitution, i.e. after the JSON value has been substituted, the parsing context has changed, as we would only permit a comma (followed by more key/value pairs), or a closing brace; nothing else is acceptable. We would therefore specify anafter
Context which represents this state.- Before
the type (typically inferred) of the Context before the transition
- After
the type (typically inferred) of the Context after the transition
- Value
the type for which this Case handles conversion
- Input
the common input type to which all substitutions are converted, often (but not always)
String
- context
the Context before the substitution
- after
the Context after the substitution
- conversion
the conversion function to the Interpolator's common input type
- returns
a new Case for handling embedding a
Value
in the specified Context
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )