001package com.plivo.api.validators; 002 003import java.lang.annotation.Retention; 004import java.lang.annotation.Target; 005 006import static java.lang.annotation.ElementType.FIELD; 007import static java.lang.annotation.ElementType.PARAMETER; 008import static java.lang.annotation.RetentionPolicy.RUNTIME; 009 010@Target({FIELD, PARAMETER}) 011@Retention(value = RUNTIME) 012public @interface OneOf { 013 014 /** 015 * @return error message to return when validation fails 016 */ 017 String message() default "value not in options"; 018 019 /** 020 * @return array of possible options 021 */ 022 String[] options(); 023 024 /** 025 * @return caseSensitive of possible options 026 */ 027 boolean caseSensitive() default false; 028}