Java Code Examples for org.osgl.util.S#requireNotBlank()

The following examples show how to use org.osgl.util.S#requireNotBlank() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsonDtoPatch.java    From actframework with Apache License 2.0 5 votes vote down vote up
private JsonDtoPatch(String name, BeanSpec spec, Set<BeanSpec> circularReferenceDetector) {
    this.name = S.requireNotBlank(name);
    this.loader = valueLoaderOf(spec);
    if (null == loader) {
        for (BeanSpec fieldSpec : spec.nonStaticFields()) {
            if (circularReferenceDetector.contains(fieldSpec)) {
                continue;
            }
            circularReferenceDetector.add(fieldSpec);
            if (fieldSpec.isTransient()
                    || fieldSpec.hasAnnotation(Transient.class)
                    || fieldSpec.hasAnnotation(NoBind.class)
            ) {
                continue;
            }
            Class fieldType = fieldSpec.rawType();
            if (App.class == fieldType || Class.class == fieldType || Object.class == fieldType
                    || Field.class == fieldType || ResourceBundle.class == fieldType
                    || Collection.class.isAssignableFrom(fieldType)
                    || Map.class.isAssignableFrom(fieldType)
            ) {
                continue;
            }
            String fieldName = fieldSpec.name();
            JsonDtoPatch child = new JsonDtoPatch(fieldName, fieldSpec, circularReferenceDetector);
            if (!child.isEmpty()) {
                fieldsPatches.add(child);
            }
            circularReferenceDetector.remove(fieldSpec);
        }
    }
}
 
Example 2
Source File: NamedListProvider.java    From actframework with Apache License 2.0 4 votes vote down vote up
public NamedListProvider(String listName) {
    this.listName = S.requireNotBlank(listName);
}
 
Example 3
Source File: LoginEvent.java    From actframework with Apache License 2.0 4 votes vote down vote up
public LoginEvent(String identifier) {
    this.identifier = S.requireNotBlank(identifier);
}
 
Example 4
Source File: ScenarioComparator.java    From actframework with Apache License 2.0 4 votes vote down vote up
public ScenarioComparator(String finalPartition) {
    this.finished = false;
    this.finalPartition = S.requireNotBlank(finalPartition);
}
 
Example 5
Source File: CaptchaSession.java    From actframework with Apache License 2.0 3 votes vote down vote up
/**
 * Construct a CAPTCHA session with text, an answer and a media URL.
 *
 * @param text the text literal
 * @param answer
 *      the answer, optional. When omitted then the answer should be
 *      the text.
 * @param mediaUrl
 *      the media URL. When omitted, then the URL is /~/captcha/{encrypted-text}.
 * @param instruction
 *      the instruction to guide how end user should treat the CAPTCHA.
 * @param options
 *      the optional a set of option from which the answer could be selected.
 */
public CaptchaSession(String text, String answer, String mediaUrl, String instruction, Set<String> options) {
    this.caption = I18n.i18n(act_messages.class, "act.captcha.caption");
    this.text = S.requireNotBlank(text);
    this.answer = answer;
    this.mediaUrl = ensureMediaUrl(mediaUrl, text);
    this.instruction = S.requireNotBlank(instruction);
    this.options = options;
}