All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javers.core.metamodel.clazz.ClientsClassDefinitionBuilder Maven / Gradle / Ivy

There is a newer version: 7.6.1
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy