Java Code Examples for org.apache.commons.lang3.ArrayUtils.removeElement()

The following are Jave code examples for showing how to use removeElement() of the org.apache.commons.lang3.ArrayUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: javadoc2swagger   File: DefinitionParser.java   Source Code and License Vote up 6 votes
private Definition getDefinitionByClass(Class<?> cls, String className, Definition rootDefinition)
        throws ParserException {

    Field[] fields = cls.getDeclaredFields();

    // if cls is enum, remove the values field
    if (cls.isEnum()) {
        for (int i = fields.length - 1; i >= 0; i--) {
            if (!fields[i].isEnumConstant()) {
                fields = ArrayUtils.removeElement(fields, fields[i]);
                break;
            }
        }
    }

    Definition definition = new Definition();
    definition.setClassName(className);
    if (rootDefinition == null) {
        rootDefinition = definition;
    }
    List<Property> properties = processFields(fields, definition, rootDefinition);
    definition.setProperties(properties);
    return definition;
}
 
Example 2
Project: springboot-shiro-cas-mybatis   File: AbstractCasWebflowConfigurer.java   Source Code and License Vote up 5 votes
/**
 * Gets flow definition ids.
 *
 * @param excludedFlowIds the excluded flow ids
 * @return the flow definition ids
 */
protected List<String> getFlowDefinitionIds(final String[] excludedFlowIds) {
    String[] flowIds = loginFlowDefinitionRegistry.getFlowDefinitionIds();

    for (final String flowId : excludedFlowIds) {
        flowIds = ArrayUtils.removeElement(flowIds, flowId);
    }
    return Arrays.asList(flowIds);
}
 
Example 3
Project: cas-server-4.2.1   File: AbstractCasWebflowConfigurer.java   Source Code and License Vote up 5 votes
/**
 * Gets flow definition ids.
 *
 * @param excludedFlowIds the excluded flow ids
 * @return the flow definition ids
 */
protected List<String> getFlowDefinitionIds(final String[] excludedFlowIds) {
    String[] flowIds = loginFlowDefinitionRegistry.getFlowDefinitionIds();

    for (final String flowId : excludedFlowIds) {
        flowIds = ArrayUtils.removeElement(flowIds, flowId);
    }
    return Arrays.asList(flowIds);
}
 
Example 4
Project: sbc-qsystem   File: FBreaksChangeDialog.java   Source Code and License Vote up 5 votes
@Action
public void removeButton() {
    if (list.getSelectedIndex() != -1) {
        breaks = (QBreak[]) ArrayUtils.removeElement(breaks, list.getSelectedValue());
        QBreaksList.getInstance().addBreakForDelete((QBreak) list.getSelectedValue());
        loadBreaks(breaks);
    }
}