Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

SerializableComparator.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import java.io.Serializable;
  18. import java.util.Comparator;
  19. /**
  20. * A {@link Comparator} that is also {@link Serializable}.
  21. * <p>
  22. * You can create a serializable comparator from a regular comparator through a
  23. * method reference by appending <code>::compare</code>. For example
  24. * <code>SerializableComparator&lt;Employee&gt;
  25. * comparator = Comparator.comparing(Employee::getFirstName)::compare</code>.
  26. * The resulting comparator will in most cases cause exceptions if it is
  27. * actually being serialized, but this construct will enable using the
  28. * shorthands in {@link Comparator} in applications where session will not be
  29. * serialized.
  30. *
  31. * @author Vaadin Ltd
  32. * @param <T>
  33. * the type of objects that may be compared by this comparator
  34. * @since 8.0
  35. *
  36. */
  37. @FunctionalInterface
  38. public interface SerializableComparator<T> extends Comparator<T>, Serializable {
  39. // Relevant methods inherited from Comparator
  40. }