DataProvider.java (vaadin-flow-4.0.5) | : | DataProvider.java (vaadin-flow-4.0.6) | ||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
* | * | |||
* Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |||
* License for the specific language governing permissions and limitations under | * License for the specific language governing permissions and limitations under | |||
* the License. | * the License. | |||
*/ | */ | |||
package com.vaadin.flow.data.provider; | package com.vaadin.flow.data.provider; | |||
import java.io.Serializable; | import java.io.Serializable; | |||
import java.util.ArrayList; | ||||
import java.util.Arrays; | import java.util.Arrays; | |||
import java.util.Collection; | import java.util.Collection; | |||
import java.util.Objects; | import java.util.Objects; | |||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | |||
import java.util.stream.Stream; | import java.util.stream.Stream; | |||
import com.vaadin.flow.data.binder.HasDataProvider; | import com.vaadin.flow.data.binder.HasDataProvider; | |||
import com.vaadin.flow.data.binder.HasFilterableDataProvider; | import com.vaadin.flow.data.binder.HasFilterableDataProvider; | |||
import com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback; | import com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback; | |||
import com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback; | import com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback; | |||
skipping to change at line 294 | skipping to change at line 295 | |||
* the provided array will not be visible via the created data provider. | * the provided array will not be visible via the created data provider. | |||
* | * | |||
* @param <T> | * @param <T> | |||
* the data item type | * the data item type | |||
* @param items | * @param items | |||
* the data items | * the data items | |||
* @return a new list data provider | * @return a new list data provider | |||
*/ | */ | |||
@SafeVarargs | @SafeVarargs | |||
static <T> ListDataProvider<T> ofItems(T... items) { | static <T> ListDataProvider<T> ofItems(T... items) { | |||
return new ListDataProvider<>(Arrays.asList(items)); | return new ListDataProvider<>(new ArrayList<>(Arrays.asList(items))); | |||
} | } | |||
/** | /** | |||
* Creates a new data provider from the given stream. <b>All items in the | * Creates a new data provider from the given stream. <b>All items in the | |||
* stream are eagerly collected to a list.</b> | * stream are eagerly collected to a list.</b> | |||
* <p> | * <p> | |||
* This is a shorthand for using {@link #ofCollection(Collection)} after | * This is a shorthand for using {@link #ofCollection(Collection)} after | |||
* collecting the items in the stream to a list with e.g. | * collecting the items in the stream to a list with e.g. | |||
* {@code stream.collect(Collectors.toList));}. | * {@code stream.collect(Collectors.toList));}. | |||
* <p> | * <p> | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |