List of usage examples for org.apache.commons.collections ListUtils EMPTY_LIST
List EMPTY_LIST
To view the source code for org.apache.commons.collections ListUtils EMPTY_LIST.
Click Source Link
From source file:org.openhab.core.items.GroupItem.java
/** * The accepted command types of a group item is the same as of the underlying base item. * If none is defined, the intersection of all sets of accepted command types of all group * members is used instead./*from www .j a v a 2 s. c o m*/ * * @return the accepted command types of this group item */ @SuppressWarnings("unchecked") public List<Class<? extends Command>> getAcceptedCommandTypes() { if (baseItem != null) { return baseItem.getAcceptedCommandTypes(); } else { List<Class<? extends Command>> acceptedCommandTypes = null; for (Item item : members) { if (acceptedCommandTypes == null) { acceptedCommandTypes = item.getAcceptedCommandTypes(); } else { acceptedCommandTypes = ListUtils.intersection(acceptedCommandTypes, item.getAcceptedCommandTypes()); } } return acceptedCommandTypes == null ? ListUtils.EMPTY_LIST : acceptedCommandTypes; } }
From source file:org.openmrs.web.controller.concept.ConceptReferenceTermFormController.java
@SuppressWarnings("unchecked") @ModelAttribute("referenceTermMappingsToThisTerm") public List<ConceptReferenceTermMap> getConceptMappingsToThisTerm( @ModelAttribute ConceptReferenceTerm conceptReferenceTerm) { if (conceptReferenceTerm.getConceptReferenceTermId() != null) { return Context.getConceptService().getReferenceTermMappingsTo(conceptReferenceTerm); }//from ww w . jav a 2 s. c om return ListUtils.EMPTY_LIST; }
From source file:org.pentaho.platform.plugin.services.connections.mondrian.MDXMetaDataTest.java
@Test public void testMetadataForEmptyPositions() { Axis axColumn = mockAxis(ListUtils.EMPTY_LIST); Axis axRow = mockAxis(ListUtils.EMPTY_LIST); Axis[] axes = new Axis[] { axColumn, axRow }; Result nativeResultSet = mock(Result.class); when(nativeResultSet.getAxes()).thenReturn(axes); MDXMetaData metadata = new MDXMetaData(nativeResultSet); checkEmptyResult(metadata);/* w ww . java 2s . c o m*/ }
From source file:org.pentaho.platform.plugin.services.connections.xquery.XQueryIT.java
public void testXQConnectionExequtePreparedQuery() { try {//from ww w . j a va 2 s . c o m XQConnection connection = new XQConnection(); connection.prepareAndExecuteQuery(TEST_QUERY, ListUtils.EMPTY_LIST); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // valid } catch (Exception e) { fail("Should throw UnsupportedOperationException"); } }
From source file:org.polymap.core.model2.store.feature.FeatureStoreUnitOfWork.java
@Override public <T extends Entity> CompositeState newEntityState(Object id, Class<T> entityClass) { // find schema for entity FeatureStore fs = featureSource(entityClass); FeatureType schema = fs.getSchema(); // create feature Feature feature = null;/* w w w. j av a2 s . com*/ if (schema instanceof SimpleFeatureType) { feature = SimpleFeatureBuilder.build((SimpleFeatureType) schema, ListUtils.EMPTY_LIST, (String) id); } else { throw new UnsupportedOperationException("Complex FeatureType is not supported yet."); } feature.getUserData().put("__created__", Boolean.TRUE); return new FeatureCompositeState(feature, this); }
From source file:org.sonar.javascript.ast.parser.TreeFactory.java
public ParameterListTreeImpl newFormalRestParameterList(RestElementTreeImpl restParameter) { return new ParameterListTreeImpl(Kind.FORMAL_PARAMETER_LIST, new SeparatedList<Tree>(Lists.newArrayList((Tree) restParameter), ListUtils.EMPTY_LIST, ImmutableList.of((AstNode) restParameter))); }
From source file:org.sonar.javascript.ast.parser.TreeFactory.java
public TemplateLiteralTreeImpl noSubstitutionTemplate(AstNode openBacktickToken, Optional<TemplateCharactersTreeImpl> templateCharacters, AstNode closeBacktickToken) { return new TemplateLiteralTreeImpl(InternalSyntaxToken.create(openBacktickToken), templateCharacters.isPresent() ? Lists.newArrayList(templateCharacters.get()) : ListUtils.EMPTY_LIST, InternalSyntaxToken.create(closeBacktickToken)); }
From source file:org.sonar.javascript.model.implementations.declaration.ObjectBindingPatternTreeImpl.java
public ObjectBindingPatternTreeImpl(InternalSyntaxToken openCurlyBrace, InternalSyntaxToken closeCurlyBrace) { super(Kind.OBJECT_BINDING_PATTERN); this.openCurlyBrace = openCurlyBrace; this.bindingElements = new SeparatedList<Tree>(ListUtils.EMPTY_LIST, ListUtils.EMPTY_LIST); this.closeCurlyBrace = closeCurlyBrace; addChildren(openCurlyBrace, closeCurlyBrace); }
From source file:org.sonar.javascript.model.implementations.declaration.ParameterListTreeImpl.java
public ParameterListTreeImpl(Kind kind, InternalSyntaxToken openParenthesis, InternalSyntaxToken closeParenthesis) { super(kind);/*from w ww . j ava 2 s.c om*/ this.kind = kind; this.openParenthesis = openParenthesis; this.parameters = new SeparatedList<Tree>(ListUtils.EMPTY_LIST, ListUtils.EMPTY_LIST); this.closeParenthesis = closeParenthesis; prependChildren(openParenthesis); addChild(closeParenthesis); }
From source file:org.sonar.javascript.model.implementations.expression.ArrayLiteralTreeImpl.java
public ArrayLiteralTreeImpl(InternalSyntaxToken openBracket, InternalSyntaxToken closeBracket) { super(Kind.ARRAY_LITERAL); this.openBracket = openBracket; this.elements = new SeparatedList<ExpressionTree>(ListUtils.EMPTY_LIST, ListUtils.EMPTY_LIST); this.closeBracket = closeBracket; addChildren(openBracket, closeBracket); }