org.hisp.dhis.query.Operator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dhis2-java-client Show documentation
Show all versions of dhis2-java-client Show documentation
DHIS 2 API client for Java.
package org.hisp.dhis.query;
/**
* Enumeration of query filter operators.
*
* @author Lars Helge Overland
*/
public enum Operator
{
EQ( "eq", "=" ),
GE( "ge", ">=" ),
GT( "gt", ">" ),
LE( "le", "<=" ),
LT( "lt", "<" ),
LIKE( "like", "like" ),
IN( "in", "in" );
private String value;
private String sqlOperator;
Operator( String value, String sqlOperator )
{
this.value = value;
this.sqlOperator = sqlOperator;
}
public static Operator fromValue( String value )
{
for ( Operator operator : Operator.values() )
{
if ( operator.value().equals( value ) )
{
return operator;
}
}
throw new IllegalArgumentException( String.format( "No enum for value: '%s'", value ) );
}
public String value()
{
return value;
}
public String sqlOperator()
{
return sqlOperator;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy