001package service.tut.pori.apilta.sensors.datatypes;
002
003import javax.xml.bind.annotation.XmlAccessType;
004import javax.xml.bind.annotation.XmlAccessorType;
005import javax.xml.bind.annotation.XmlElement;
006import javax.xml.bind.annotation.XmlRootElement;
007
008import org.apache.commons.lang3.StringUtils;
009
010/**
011 * Answers to the question "what does this task generate?"
012 *
013 */
014@XmlRootElement(name=Definitions.ELEMENT_OUTPUT)
015@XmlAccessorType(XmlAccessType.NONE)
016public class Output {
017  @XmlElement(name = Definitions.ELEMENT_FEATURE)
018  private String _feature = null;
019
020  /**
021   * @return the feature
022   * @see #setFeature(String)
023   */
024  public String getFeature() {
025    return _feature;
026  }
027
028  /**
029   * @param feature the feature to set
030   * @see #getFeature()
031   */
032  public void setFeature(String feature) {
033    _feature = feature;
034  }
035  
036  /**
037   * for sub-classing, use the static
038   * 
039   * @return true if valid
040   * @see #isValid(Output)
041   */
042  protected boolean isValid() {
043    return !StringUtils.isBlank(_feature);
044  }
045
046  /**
047   * 
048   * @param output
049   * @return false if output is null or invalid
050   */
051  public static boolean isValid(Output output) {
052    if(output == null){
053      return false;
054    }else{
055      return output.isValid();
056    }
057  }
058}