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

com.regnosys.rosetta.translate.datamodel.Entity Maven / Gradle / Ivy

There is a newer version: 11.25.1
Show newest version
package com.regnosys.rosetta.translate.datamodel;

import java.util.List;
import java.util.Set;
import java.util.stream.Stream;

import com.regnosys.rosetta.common.util.StreamUtils;

/**
 * @author TomForwood
 *
 */
public interface Entity {

	NamespaceName getName();

	List getAttributes();

	void addAttribute(Attribute att);

	Entity getExtendedEntity();

	List getKnownExtendingEntities();

	default Stream getAllPossibleAttributes() {
		return StreamUtils.flattenTreeC(this, e -> e.getKnownExtendingEntities())
				.flatMap(e -> e.getAttributes().stream()).distinct();
	}

	boolean hasChild();

	boolean hasData();

	/**
	 * @param alreadyWritten - names of entities that have already been written to
	 *                       prevent cycles in the recursion
	 * @return a string representation of this entity that doesn't contain cycles
	 */
	String toString(Set alreadyWritten);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy