Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

PropertySet.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2000-2016 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.data;
  17. import java.io.Serializable;
  18. import java.util.Optional;
  19. import java.util.stream.Stream;
  20. /**
  21. * Describes a set of properties that can be used for configuration based on
  22. * property names instead of setter and getter callbacks.
  23. *
  24. * @author Vaadin Ltd
  25. *
  26. * @since
  27. *
  28. * @param <T>
  29. * the type for which the properties are defined
  30. */
  31. public interface PropertySet<T> extends Serializable {
  32. /**
  33. * Gets all known properties as a stream.
  34. *
  35. * @return a stream of property names, not <code>null</code>
  36. */
  37. public Stream<PropertyDefinition<T, ?>> getProperties();
  38. /**
  39. * Gets the definition for the named property, or an empty optional if there
  40. * is no property with the given name.
  41. *
  42. * @param name
  43. * the property name to look for, not <code>null</code>
  44. * @return the property definition, or empty optional if property doesn't
  45. * exist
  46. */
  47. public Optional<PropertyDefinition<T, ?>> getProperty(String name);
  48. }