Serializable
, Comparable<ComplementaryExpositionMethod>
public enum ComplementaryExpositionMethod extends Enum<ComplementaryExpositionMethod>
Enum Constant | Description |
---|---|
ANY_OF |
This can be used to indcate that, for the annotated element, method name
anyOfXXX that return anyOf matcher must be created. |
ARRAYCONTAINING |
This can be used to indicate that, for the annotated element, method
named
arrayContainingXXX that returns Matcher for array must be
created. |
CONTAINS |
This can be used to indicate that, for the annotated element, method
named
containsXXX that returns Matcher for Iterable must
be created. |
HAS_ITEMS |
This can be used to indicate that, for the annotated element, method name
hasItemsXXX that return hasItems matcher must be created. |
Modifier and Type | Method | Description |
---|---|---|
static ComplementaryExpositionMethod |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static ComplementaryExpositionMethod[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ComplementaryExpositionMethod CONTAINS
containsXXX
that returns Matcher for Iterable
must
be created.
For example, for a class Pojo1
, this will add the following
elements to the generated classes :
@org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first) { return org.hamcrest.Matchers.contains(pojo1WithSameValue(first)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second) { return org.hamcrest.Matchers.contains(pojo1WithSameValue(first), pojo1WithSameValue(second)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third) { return org.hamcrest.Matchers.contains(pojo1WithSameValue(first), pojo1WithSameValue(second), pojo1WithSameValue(third)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third, ch.powerunit.extensions.matchers.samples.Pojo1... last) { java.util.List<org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1>> tmp = new java.util.ArrayList<>( java.util.Arrays.asList(pojo1WithSameValue(first), pojo1WithSameValue(second), pojo1WithSameValue(third))); tmp.addAll(java.util.Arrays.stream(last).map(v -> pojo1WithSameValue(v)) .collect(java.util.stream.Collectors.toList())); return org.hamcrest.Matchers.contains(tmp.toArray(new org.hamcrest.Matcher[0])); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first) { return org.hamcrest.Matchers.containsInAnyOrder(pojo1WithSameValue(first)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second) { return org.hamcrest.Matchers.containsInAnyOrder(pojo1WithSameValue(first), pojo1WithSameValue(second)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third) { return org.hamcrest.Matchers.containsInAnyOrder(pojo1WithSameValue(first), pojo1WithSameValue(second), pojo1WithSameValue(third)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<? extends ch.powerunit.extensions.matchers.samples.Pojo1>> containsInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third, ch.powerunit.extensions.matchers.samples.Pojo1... last) { java.util.List<org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1>> tmp = new java.util.ArrayList<>( java.util.Arrays.asList(pojo1WithSameValue(first), pojo1WithSameValue(second), pojo1WithSameValue(third))); tmp.addAll(java.util.Arrays.stream(last).map(v -> pojo1WithSameValue(v)) .collect(java.util.stream.Collectors.toList())); return org.hamcrest.Matchers.containsInAnyOrder(tmp.toArray(new org.hamcrest.Matcher[0])); }
public static final ComplementaryExpositionMethod ARRAYCONTAINING
arrayContainingXXX
that returns Matcher for array must be
created.
For example, for a class Pojo1
, this will add the following
elements to the generated classes :
@org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingPojo1(ch.powerunit.extensions.matchers.samples.Pojo1 first) { return org.hamcrest.Matchers.arrayContaining(pojo1WithSameValue(first)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second) { return org.hamcrest.Matchers.arrayContaining(pojo1WithSameValue(first),pojo1WithSameValue(second)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third) { return org.hamcrest.Matchers.arrayContaining(pojo1WithSameValue(first),pojo1WithSameValue(second),pojo1WithSameValue(third)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third, ch.powerunit.extensions.matchers.samples.Pojo1... last) { java.util.List<org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 >> tmp = new java.util.ArrayList<>(java.util.Arrays.asList(pojo1WithSameValue(first),pojo1WithSameValue(second),pojo1WithSameValue(third))); tmp.addAll(java.util.Arrays.stream(last).map(v->pojo1WithSameValue(v)).collect(java.util.stream.Collectors.toList())); return org.hamcrest.Matchers.arrayContaining(tmp.toArray(new org.hamcrest.Matcher[0])); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingInAnyOrderPojo1(ch.powerunit.extensions.matchers.samples.Pojo1 first) { return org.hamcrest.Matchers.arrayContainingInAnyOrder(pojo1WithSameValue(first)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second) { return org.hamcrest.Matchers.arrayContainingInAnyOrder(pojo1WithSameValue(first),pojo1WithSameValue(second)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third) { return org.hamcrest.Matchers.arrayContainingInAnyOrder(pojo1WithSameValue(first),pojo1WithSameValue(second),pojo1WithSameValue(third)); } @org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 []> arrayContainingInAnyOrderPojo1( ch.powerunit.extensions.matchers.samples.Pojo1 first, ch.powerunit.extensions.matchers.samples.Pojo1 second, ch.powerunit.extensions.matchers.samples.Pojo1 third, ch.powerunit.extensions.matchers.samples.Pojo1... last) { java.util.List<org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 >> tmp = new java.util.ArrayList<>(java.util.Arrays.asList(pojo1WithSameValue(first),pojo1WithSameValue(second),pojo1WithSameValue(third))); tmp.addAll(java.util.Arrays.stream(last).map(v->pojo1WithSameValue(v)).collect(java.util.stream.Collectors.toList())); return org.hamcrest.Matchers.arrayContainingInAnyOrder(tmp.toArray(new org.hamcrest.Matcher[0])); }
public static final ComplementaryExpositionMethod HAS_ITEMS
hasItemsXXX
that return hasItems matcher must be created.
For example, for a class Pojo1
, this will add the following
elements to the generated classes :
@org.hamcrest.Factory public static org.hamcrest.Matcher<java.lang.Iterable<ch.powerunit.extensions.matchers.samples.Pojo1 >> hasItemsPojo1(ch.powerunit.extensions.matchers.samples.Pojo1 ... item) { return org.hamcrest.Matchers.hasItems(java.util.Arrays.stream(item).map(v->pojo1WithSameValue(v)).collect(java.util.stream.Collectors.toList()).toArray(new org.hamcrest.Matcher[0])); }
public static final ComplementaryExpositionMethod ANY_OF
anyOfXXX
that return anyOf matcher must be created.
For example, for a class Pojo1
, this will add the following
elements to the generated classes :
@org.hamcrest.Factory public static org.hamcrest.Matcher<ch.powerunit.extensions.matchers.samples.Pojo1 > anyOfPojo1(ch.powerunit.extensions.matchers.samples.Pojo1 ... items) { return org.hamcrest.Matchers.anyOf(java.util.Arrays.stream(items).map(v->pojo1WithSameValue(v)).collect(java.util.stream.Collectors.toList()).toArray(new org.hamcrest.Matcher[0])); }
public static ComplementaryExpositionMethod[] values()
for (ComplementaryExpositionMethod c : ComplementaryExpositionMethod.values()) System.out.println(c);
public static ComplementaryExpositionMethod valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2018. All rights reserved.