org.javers.core.metamodel.clazz.ClientsClassDefinitionBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javers-core Show documentation
Show all versions of javers-core Show documentation
JaVers - object auditing and diff framework for Java
package org.javers.core.metamodel.clazz;
import org.javers.common.collections.Lists;
import java.util.Optional;
import org.javers.common.validation.Validate;
import java.util.Collections;
import java.util.List;
/**
* @since 1.4
* @author bartosz.walacik
*/
public abstract class ClientsClassDefinitionBuilder {
private Class clazz;
private List ignoredProperties = Collections.emptyList();
private Optional typeName = Optional.empty();
ClientsClassDefinitionBuilder(Class clazz) {
this.clazz = clazz;
}
public T withIgnoredProperties(String... ignoredProperties) {
withIgnoredProperties(Lists.asList(ignoredProperties));
return (T) this;
}
public T withIgnoredProperties(List ignoredProperties) {
Validate.argumentIsNotNull(ignoredProperties);
this.ignoredProperties = ignoredProperties;
return (T) this;
}
public T withTypeName(Optional typeName) {
Validate.argumentIsNotNull(typeName);
this.typeName = typeName;
return (T) this;
}
public T withTypeName(String typeName) {
return withTypeName(Optional.ofNullable(typeName));
}
public ClientsClassDefinition build() {
throw new RuntimeException("not implemented");
}
public Class getClazz() {
return clazz;
}
public List getIgnoredProperties() {
return ignoredProperties;
}
public Optional getTypeName() {
return typeName;
}
}