/src/main/java/nl/bitbrains/nebu/common/topology/PhysicalResourceBuilder.java

https://github.com/deltaforge/nebu-common-java · Java · 47 lines · 20 code · 7 blank · 20 comment · 0 complexity · 736e3efc310da3fcdfc9eb17ea2bf884 MD5 · raw file

  1. package nl.bitbrains.nebu.common.topology;
  2. import nl.bitbrains.nebu.common.interfaces.IBuilder;
  3. import nl.bitbrains.nebu.common.util.ErrorChecker;
  4. /**
  5. * Builder for the PhysicalResources.
  6. *
  7. * @param <T>
  8. * Type to build.
  9. * @author Jesse Donkervliet, Tim Hegeman, and Stefan Hugtenburg
  10. */
  11. public abstract class PhysicalResourceBuilder<T> implements IBuilder<T> {
  12. private String uuid;
  13. /**
  14. * Simple default (empty) constructor.
  15. */
  16. public PhysicalResourceBuilder() {
  17. }
  18. @Override
  19. public void reset() {
  20. this.uuid = null;
  21. }
  22. /**
  23. * @param uuid
  24. * to set.
  25. * @return this for fluency.
  26. */
  27. public PhysicalResourceBuilder<T> withUuid(final String uuid) {
  28. ErrorChecker.throwIfNullArgument(uuid, PhysicalResource.UUID_NAME);
  29. this.uuid = uuid;
  30. return this;
  31. }
  32. /**
  33. * Simple getter.
  34. *
  35. * @return the uuid.
  36. */
  37. protected String getUUID() {
  38. return this.uuid;
  39. }
  40. }