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

com.sap.cloud.sdk.service.csn2jpa.cds.model.CdsEntity Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
/*******************************************************************************
 * * © 2018 SAP SE or an SAP affiliate company. All rights reserved. *
 ******************************************************************************/
package com.sap.cloud.sdk.service.csn2jpa.cds.model;

public class CdsEntity extends CdsDefinition {

	private boolean isAbstract = false;
	private CdsStructuredType type;

	public CdsEntity() {
	}

	public CdsEntity(CdsContext context, String name) {
		super(context, name);
	}

	public boolean isAbstract() {
		return isAbstract;
	}

	public void setAbstract(boolean isAbstract) {
		this.isAbstract = isAbstract;
	}

	public CdsStructuredType getType() {
		return type;
	}

	public void setType(CdsStructuredType type) {
		this.type = type;
	}

	public boolean hasElementWithName(String name) {
		return type.getElements().stream().anyMatch(e -> name.equals(e.getName()));
	}

	@Override
	public void accept(CdsVisitor visitor) {
		type.accept(visitor);

		visitor.visit(this);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy