fr.ird.observe.dto.reference.ReferentialDtoReferenceDefinition Maven / Gradle / Ivy
Show all versions of common-dto Show documentation
package fr.ird.observe.dto.reference;
/*-
* #%L
* ObServe Toolkit :: Common Dto
* %%
* Copyright (C) 2017 - 2020 IRD, Ultreia.io
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* .
* #L%
*/
import com.google.common.collect.ImmutableMap;
import fr.ird.observe.dto.referential.ReferentialDto;
import java.util.function.Function;
/**
* Describe the definition of a reference on a dto.
*
* Created on 11/11/15.
*
* @author Tony Chemit - [email protected]
*/
public class ReferentialDtoReferenceDefinition> extends DtoReferenceDefinition {
private static final long serialVersionUID = 1L;
public static > Builder> builder(Class dtoType, Class type) {
return new Builder>(dtoType, type) {
@Override
public ReferentialDtoReferenceDefinition build() {
return new ReferentialDtoReferenceDefinition<>(dtoType, referenceType, propertiesBuilder.build(), functionsBuilder.build());
}
};
}
private ReferentialDtoReferenceDefinition(Class dtoType, Class referenceType, ImmutableMap> properties, ImmutableMap> functions) {
super(dtoType, referenceType, properties, functions);
}
}