/** * @throws MissingThingIdsException When {@code thingIds} is empty */ private RetrieveThings(final List<String> thingIds, @Nullable final JsonFieldSelector selectedFields, @Nullable final String namespace, final DittoHeaders dittoHeaders) { super(TYPE, dittoHeaders); if (thingIds.isEmpty()) { throw MissingThingIdsException.newBuilder() .dittoHeaders(dittoHeaders) .build(); } this.thingIds = Collections.unmodifiableList(new ArrayList<>(thingIds)); this.selectedFields = selectedFields; this.namespace = checkForDistinctNamespace(namespace, thingIds); }
/** * @throws MissingThingIdsException When {@code thingIds} is empty */ private RetrieveThings(final List<String> thingIds, @Nullable final JsonFieldSelector selectedFields, @Nullable final String namespace, final DittoHeaders dittoHeaders) { super(TYPE, dittoHeaders); if (thingIds.isEmpty()) { throw MissingThingIdsException.newBuilder() .dittoHeaders(dittoHeaders) .build(); } this.thingIds = Collections.unmodifiableList(new ArrayList<>(thingIds)); this.selectedFields = selectedFields; this.namespace = checkForDistinctNamespace(namespace, thingIds); }