Project

General

Profile

« Previous | Next » 

Revision 9b8a8049

Added by Andreas Müller over 2 years ago

ref #9804 improve handling for empty categorical data (empty or null value state data)

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/CategoricalData.java
208 208
// ********************* CONVENIENCE ******************************************/
209 209

  
210 210
    /**
211
     * Convenience method which returns only the list of states. Leaving out modifiers and modifying text.
212
     * @return
211
     * Convenience method returning only the list of states. Leaving out modifiers and modifying text.
213 212
     */
214 213
    @Transient
215 214
    public List<State> getStatesOnly(){
216
        List<State> result = new ArrayList<State>();
215
        List<State> result = new ArrayList<>();
217 216
        for (StateData stateData : getStateData()){
218 217
            State state = stateData.getState();
219
            result.add(state);
218
            if (state != null){
219
                result.add(state);
220
            }
220 221
        }
221 222
        return result;
222 223
    }

Also available in: Unified diff