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

org.eurekaclinical.eureka.client.comm.PropositionWrapper Maven / Gradle / Ivy

The newest version!
/*
 * #%L
 * Eureka Common
 * %%
 * Copyright (C) 2012 - 2013 Emory University
 * %%
 * 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.
 * #L%
 */
package org.eurekaclinical.eureka.client.comm;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

/**
 * Represents messages containing phenotype definitions.
 *
 * @author hrathod
 */
public class PropositionWrapper implements Serializable {

    public enum Type {
        CATEGORIZATION, SEQUENCE, FREQUENCY, VALUE_THRESHOLD, SYSTEM
    }

    private Long id;
    private String key;
    private Long userId;
    private String abbrevDisplayName;
    private String displayName;
    private Type type;
    private boolean inSystem;
    private List children;
    private List properties;
    private Date created;
    private Date lastModified;
    private boolean summarized;
    private boolean parent;

    /**
     * Creates the message object.
     */
    public PropositionWrapper() {
        children = new ArrayList<>();
    }

    /**
     * Returns a user phenotype definition's id.
     *
     * @return a {@link Long}. Will be null for a system data
     * element definition.
     */
    public Long getId() {
        return id;
    }

    /**
     * Sets a user phenotype definition's id.
     *
     * @param id a {@link Long}.
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Returns a system phenotype definition's id string.
     *
     * @return a {@link String}. Will be null for a user data
     * element definition.
     */
    public String getKey() {
        return key;
    }

    /**
     * Sets a system phenotype definition's id string.
     *
     * @param inKey a {@link String}.
     */
    public void setKey(String inKey) {
        key = inKey;
    }

    /**
     * Returns a user phenotype definition's user id.
     *
     * @return a {@link Long}.
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * Sets a user phenotype definition's user id.
     *
     * @param userId a {@link Long}.
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * Gets the phenotype definition's abbreviated display name.
     *
     * @return a {@link String}. May be null if no abbreviated
     * display name is specified.
     */
    public String getAbbrevDisplayName() {
        return abbrevDisplayName;
    }

    /**
     * Sets the phenotype definition's abbreviated display name.
     *
     * @param abbrevDisplayName a {@link String}. Passing in null
     * will set the abbreviated display name as unspecified.
     */
    public void setAbbrevDisplayName(String abbrevDisplayName) {
        this.abbrevDisplayName = abbrevDisplayName;
    }

    /**
     * Gets the phenotype definition's display name.
     *
     * @return a {@link String}. A value of null means that no
     * display name is specified.
     */
    public String getDisplayName() {
        return displayName;
    }

    /**
     * Sets the phenotype definition's display name.
     *
     * @param displayName a {@link String}. Passing in null will
     * set the abbreviated display name as unspecified.
     */
    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    /**
     * Gets the type of a user phenotype definition.
     *
     * @return a {@link Type}. Will be null if a system data
     * element definition.
     */
    public Type getType() {
        return type;
    }

    /**
     * Sets the type of a user phenotype definition.
     *
     * @param type a {@link Type}. Should be null for a system data
     * element definition.
     */
    public void setType(Type type) {
        this.type = type;
    }

    /**
     * Gets whether this phenotype definition is a system or user data element
     * definition.
     *
     * @return true if a system phenotype definition,
     * false if a user phenotype definition.
     */
    public boolean isInSystem() {
        return inSystem;
    }

    /**
     * Sets whether this phenotype definition is a aystem or user data element
     * definition.
     *
     * @param inSystem true if a system phenotype definition,
     * false if a user phenotype definition.
     */
    public void setInSystem(boolean inSystem) {
        this.inSystem = inSystem;
    }

    /**
     * Gets the creation date of this phenotype definition.
     *
     * @return the creation {@link Date}, or null if the creation
     * date is unspecified.
     */
    public Date getCreated() {
        return created;
    }

    /**
     * Sets the creation date of this phenotype definition.
     *
     * @param inCreated the creation {@link Date}, or null if the
     * creation date is unspecified.
     */
    public void setCreated(Date inCreated) {
        created = inCreated;
    }

    /**
     * Gets the last modified date of this phenotype definition.
     *
     * @return the last modified {@link Date}, or null if the last
     * modified date is unspecified.
     */
    public Date getLastModified() {
        return lastModified;
    }

    /**
     * Sets the last modified date of this phenotype definition.
     *
     * @param inLastModified the last modified {@link Date}, or
     * null if the last modified date is unspecified.
     */
    public void setLastModified(Date inLastModified) {
        lastModified = inLastModified;
    }

    /**
     * Gets whether or not the children of this proposition are included in the
     * message.
     *
     * @return true if the children of this proposition are
     * included, false otherwise.
     */
    public boolean isSummarized() {
        return summarized;
    }

    /**
     * Sets whether or not the children of this proposition are included in the
     * message.
     *
     * @param inSummarized true if the children of this proposition
     * are included, false otherwise.
     */
    public void setSummarized(boolean inSummarized) {
        summarized = inSummarized;
    }

    /**
     * Gets this phenotype definition's children, if any.
     *
     * @return a {@link List} of this phenotype definition's children, if any.
     */
    public List getChildren() {
        return children;
    }

    /**
     * Sets this phenotype definition's children.
     *
     * @param inChildren a {@link List} of this phenotype definition's children.
     */
    public void setChildren(List inChildren) {
        children = inChildren;
    }

    /**
     * Gets this phenotype definition's properties, if any.
     *
     * @return a {@link List} of this phenotype definition's properties, if any
     */
    public List getProperties() {
        return properties;
    }

    /**
     * Sets this phenotype definition's properties.
     *
     * @param inProperties a {@link List} of this phenotype definition's
     * properties.
     */
    public void setProperties(List inProperties) {
        properties = inProperties;
    }

    /**
     * Returns whether this phenotype definition has children.
     *
     * @return true if this phenotype definition has children,
     * false otherwise.
     */
    public boolean isParent() {
        return parent;
    }

    /**
     * Sets whether this phenotype definition has children.
     *
     * @param inParent true if this phenotype definition has
     * children, false otherwise.
     */
    public void setParent(boolean inParent) {
        parent = inParent;
    }

    /**
     * Represents field values for debugging purposes.
     *
     * @return A string representing the state of the object.
     */
    @Override
    public String toString() {
        return "PropositionWrapper{" + "id=" + id + ", key='" + key + '\''
                + ", userId=" + userId + ", abbrevDisplayName='"
                + abbrevDisplayName + '\'' + ", displayName='" + displayName
                + '\'' + ", type=" + type + ", inSystem=" + inSystem
                + ", children=" + children.size() + ", created=" + created
                + ", lastModified=" + lastModified + ", summarized="
                + summarized + ", parent=" + parent + '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy