
com.speedment.runtime.core.manager.FieldSet Maven / Gradle / Ivy
package com.speedment.runtime.core.manager;
import com.speedment.runtime.core.internal.manager.FieldSetImpl;
import com.speedment.runtime.field.Field;
import java.util.Arrays;
import java.util.Collection;
public interface FieldSet extends HasLabelSet {
/**
* Creates a new FieldSet with the given field removed from the original set.
*
* @param field the field to remove
* @return a new FieldSet with the given field removed
*/
FieldSet except(Field field);
/**
* Creates a new FieldSet with the given field added to the original set.
*
* @param field the field to add
* @return a new FieldSet with an added field
*/
FieldSet and(Field field);
/**
* Creates a new FieldSet that represents the set of all fields of an entity except for the given ones
*
* @param fields the fields to exclude from the set
* @param the type of entity
* @return a new FieldSet that represents the set of all fields of an entity except for the given ones
*/
@SafeVarargs
static FieldSet allExcept(Field... fields) {
return new FieldSetImpl<>(Arrays.stream(fields)).negate();
}
/**
* Creates a new FieldSet that represents the given set of fields
*
* @param fields the fields to include in the set
* @param the type of entity
* @return a new FieldSet that represents the set of the given fields
*/
@SafeVarargs
static FieldSet of(Field... fields) {
return new FieldSetImpl<>(Arrays.stream(fields));
}
/**
* Creates a new FieldSet that represents the set of all fields of an entity except for the given ones
*
* @param fields the fields to exclude from the set
* @param the type of entity
* @return a new FieldSet that represents the set of all fields of an entity except for the given ones
*/
static FieldSet allExcept(Collection> fields) {
return new FieldSetImpl<>(fields.stream()).negate();
}
/**
* Creates a new FieldSet that represents the given set of fields
*
* @param fields the fields to include in the set
* @param the type of entity
* @return a new FieldSet that represents the set of the given fields
*/
static FieldSet of(Collection> fields) {
return new FieldSetImpl<>(fields.stream());
}
/**
* Returns a FieldSet that represents all the fields of the given entity
* @param classToken class token used to determine entity type
* @param the type of entity
* @return a FieldSet that represents all the fields of the given entity
*/
@SuppressWarnings("unchecked")
static FieldSet allOf(Class classToken) {
return (FieldSet) FieldSetImpl.ALL;
}
/**
* Returns a FieldSet that represents the empty set of fields of the given entity
* @param classToken class token used to determine entity type
* @param the type of entity
* @return a FieldSet that represents the empty set of fields of the given entity
*/
@SuppressWarnings("unchecked")
static FieldSet noneOf(Class classToken) {
return (FieldSet) FieldSetImpl.NONE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy