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

de.uni_hamburg.traces.peppermodules.model.ea.GeTaFC Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2016ff. Stephan Druskat
 * All exploitation rights belong exclusively to Universität Hamburg.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Contributors:
 *     Stephan Druskat - initial API and implementation
 */
package de.uni_hamburg.traces.peppermodules.model.ea;

import java.util.HashMap; 
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;

import de.uni_hamburg.traces.peppermodules.GeTaMapper;

/**
 * A bean representing an **FC** section in GeTa data.
 *
 * @author Stephan Druskat 
 *
 */
public class GeTaFC {
	
	private final Map annotations = new HashMap<>();
	private List ll;
	private GeTaEd ed;

	/**
	 * Constructor creating a JSON representation.
	 * 
	 * @param fidlet
	 * @param fidleted
	 * @param trfid
	 * @param plb
	 * @param ppb
	 * @param ed
	 * @param ll
	 */
	@JsonCreator
	@JsonIgnoreProperties(ignoreUnknown = true)
	public GeTaFC(@JsonProperty(GeTaMapper.FIDLET) String fidlet,
			@JsonProperty(GeTaMapper.FIDLETED) String fidleted,
			@JsonProperty(GeTaMapper.TRFID) String trfid,
			@JsonProperty(GeTaMapper.pLB) Integer plb,
			@JsonProperty(GeTaMapper.pPB) Integer ppb,
			@JsonProperty(GeTaMapper.Ed) GeTaEd ed,
			@JsonProperty(GeTaMapper.LL) List ll) {
				this.ll = ll;
				this.ed = ed;
				annotations.put(GeTaMapper.FIDLET, fidlet);
				annotations.put(GeTaMapper.FIDLETED, fidleted);
				annotations.put(GeTaMapper.TRFID, trfid);
				annotations.put(GeTaMapper.pLB, plb);
				annotations.put(GeTaMapper.pPB, ppb);
				// Remove null values from map
				Iterables.removeIf(annotations.keySet(), Predicates.isNull());
	}

	/**
	 * @return the ll
	 */
	public final List getLl() {
		return ll;
	}

	/**
	 * @return the annotations
	 */
	public final Map getAnnotations() {
		return annotations;
	}

	/**
	 * @return the ed
	 */
	public final GeTaEd getEd() {
		return ed;
	}
	
	/**
	 * Whether this FC instance has Ed annotations.
	 *
	 * @return
	 */
	public final boolean hasEd() {
		return ed != null;
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy