001/*
002 * Copyright 2011-2016 UnboundID Corp.
003 *
004 * This program is free software; you can redistribute it and/or modify
005 * it under the terms of the GNU General Public License (GPLv2 only)
006 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
007 * as published by the Free Software Foundation.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU General Public License for more details.
013 *
014 * You should have received a copy of the GNU General Public License
015 * along with this program; if not, see <http://www.gnu.org/licenses>.
016 */
017
018package com.unboundid.scim.sdk;
019
020
021
022/**
023 * This enumeration defines the set of possible filter types that may
024 * be used for SCIM query filters.
025 */
026public enum SCIMFilterType
027{
028  /**
029   * The filter type for AND filters.
030   */
031  AND("and"),
032
033
034
035  /**
036   * The filter type for OR filters.
037   */
038  OR("or"),
039
040
041
042  /**
043   * The filter type for equality filters.
044   */
045  EQUALITY("eq"),
046
047
048
049  /**
050   * The filter type for contains filters.
051   */
052  CONTAINS("co"),
053
054
055
056  /**
057   * The filter type for starts with filters.
058   */
059  STARTS_WITH("sw"),
060
061
062
063  /**
064   * The filter type for presence filters.
065   */
066  PRESENCE("pr"),
067
068
069
070  /**
071   * The filter type for greater than filters.
072   */
073  GREATER_THAN("gt"),
074
075
076
077  /**
078   * The filter type for greater or equal filters.
079   */
080  GREATER_OR_EQUAL("ge"),
081
082
083
084  /**
085   * The filter type for less than filters.
086   */
087  LESS_THAN("lt"),
088
089
090
091  /**
092   * The filter type for less or equal filters.
093   */
094  LESS_OR_EQUAL("le");
095
096
097
098  /**
099   * The lower case string value for this filter type.
100   */
101  private String stringValue;
102
103
104
105  /**
106   * Creates a new filter type with the provided string value.
107   *
108   * @param  stringValue  The lower case string value for this filter type.
109   */
110  private SCIMFilterType(final String stringValue)
111  {
112    this.stringValue = stringValue;
113  }
114
115
116
117  /**
118   * Retrieves the lower case string value for this filter type.
119   *
120   * @return  The lower case string value for this filter type.
121   */
122  public String getStringValue()
123  {
124    return stringValue;
125  }
126
127
128
129  /**
130   * Retrieves a string representation of this filter type.
131   *
132   * @return  A string representation of this filter type.
133   */
134  public String toString()
135  {
136    return getStringValue();
137  }
138}
139