public final class Check extends Object implements TypeTemplate
| Modifier and Type | Class and Description |
|---|---|
static class |
Check.CheckType<A> |
| Constructor and Description |
|---|
Check(String name,
int index,
TypeTemplate element) |
| Modifier and Type | Method and Description |
|---|---|
TypeFamily |
apply(TypeFamily family) |
<A,B> FamilyOptic<A,B> |
applyO(FamilyOptic<A,B> input,
Type<A> aType,
Type<B> bType) |
boolean |
equals(Object obj) |
<FT,FR> (TypeTemplate|Type.FieldNotFoundException) |
findFieldOrType(int index,
String name,
Type<FT> type,
Type<FR> resultType)
returned optic will accept
template<family<index>> with the input template, and will return the same with the returned template. |
int |
hashCode() |
(int) -> RewriteResult<?,?> |
hmap(TypeFamily family,
(int) -> RewriteResult<?,?> function)
constraint: family, argFamily and resFamily are matched.
|
int |
size() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waittoSimpleTypepublic Check(String name, int index, TypeTemplate element)
public int size()
size in interface TypeTemplatepublic TypeFamily apply(TypeFamily family)
apply in interface TypeTemplatepublic <A,B> FamilyOptic<A,B> applyO(FamilyOptic<A,B> input, Type<A> aType, Type<B> bType)
applyO in interface TypeTemplatepublic <FT,FR> (TypeTemplate|Type.FieldNotFoundException) findFieldOrType(int index, @Nullable String name, Type<FT> type, Type<FR> resultType)
TypeTemplatetemplate<family<index>> with the input template, and will return the same with the returned template.
(template, optic) = Left(result)
this.apply(family).apply(index) == optic.sType
template.apply(family).apply(index) == optic.tType
findFieldOrType in interface TypeTemplatepublic (int) -> RewriteResult<?,?> hmap(TypeFamily family, (int) -> RewriteResult<?,?> function)
TypeTemplateresult.function(i) :: this.apply(function.argFamily()).apply(i) -> this.apply(function.resFamily()).apply(i)
hmap in interface TypeTemplate