RepeatTypes.java :  » UnTagged » s00083451-s00083031-y4 » com » itsm » entities » Android Open Source

Android Open Source » UnTagged » s00083451 s00083031 y4 
s00083451 s00083031 y4 » com » itsm » entities » RepeatTypes.java
package com.itsm.entities;

import com.itsm.R;

/**
 * Enumeration for Repeat Types
 */
public enum RepeatTypes {
  Never(1, R.string.repeat_type_never), 
  Daily(2, R.string.repeat_type_daily), 
  WeekDays(3, R.string.repeat_type_weekday), 
  Weekly(4, R.string.repeat_type_weekly);

  private int value;
  private int stringValue;

  public static RepeatTypes find(int stringValue) {
    for (RepeatTypes r : RepeatTypes.values()) {
      if (r.getValue() == stringValue) {
        return r;
      }
    }
    return null;
  }

  private RepeatTypes(int value, int stringValue) {
    this.value = value;
    this.stringValue = stringValue;
  }

  public int getValue() {
    return value;
  }

  public int getStringValue() {
    return stringValue;
  }

  public static RepeatTypes getAssociatedStringValue(int val) {
    return find(val);
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.