private Query( String obj, List<String> keys, List<String> attr, Set<String> typeNames, String resultAlias, boolean useObjDomainAsKey, boolean allowDottedKeys, boolean useAllTypeNames, List<OutputWriterFactory> outputWriterFactories, List<OutputWriter> outputWriters ) { try { this.objectName = new ObjectName(obj); } catch (MalformedObjectNameException e) { throw new IllegalArgumentException("Invalid object name: " + obj, e); } this.attr = copyOf(firstNonNull(attr, Collections.<String>emptyList())); this.resultAlias = resultAlias; this.useObjDomainAsKey = firstNonNull(useObjDomainAsKey, false); this.keys = copyOf(firstNonNull(keys, Collections.<String>emptyList())); this.allowDottedKeys = allowDottedKeys; this.useAllTypeNames = useAllTypeNames; this.outputWriters = copyOf(firstNonNull(outputWriterFactories, ImmutableList.<OutputWriterFactory>of())); // We need to preserve the order of typeNames. So note that copyOf // does not mess with the order. this.typeNames = ImmutableSet.copyOf(firstNonNull(typeNames, Collections.<String>emptySet())); this.typeNameValuesStringBuilder = makeTypeNameValuesStringBuilder(); this.outputWriterInstances = copyOf(firstNonNull(outputWriters, ImmutableList.<OutputWriter>of())); }
private Query( String obj, List<String> keys, List<String> attr, Set<String> typeNames, String resultAlias, boolean useObjDomainAsKey, boolean allowDottedKeys, boolean useAllTypeNames, List<OutputWriterFactory> outputWriterFactories, List<OutputWriter> outputWriters ) { try { this.objectName = new ObjectName(obj); } catch (MalformedObjectNameException e) { throw new IllegalArgumentException("Invalid object name: " + obj, e); } this.attr = copyOf(firstNonNull(attr, Collections.<String>emptyList())); this.resultAlias = resultAlias; this.useObjDomainAsKey = firstNonNull(useObjDomainAsKey, false); this.keys = copyOf(firstNonNull(keys, Collections.<String>emptyList())); this.allowDottedKeys = allowDottedKeys; this.useAllTypeNames = useAllTypeNames; this.outputWriters = copyOf(firstNonNull(outputWriterFactories, ImmutableList.<OutputWriterFactory>of())); // We need to preserve the order of typeNames. So note that copyOf // does not mess with the order. this.typeNames = ImmutableSet.copyOf(firstNonNull(typeNames, Collections.<String>emptySet())); this.typeNameValuesStringBuilder = makeTypeNameValuesStringBuilder(); this.outputWriterInstances = copyOf(firstNonNull(outputWriters, ImmutableList.<OutputWriter>of())); }