Split out BaseTypeFactories 71/86071/5
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 29 Nov 2019 15:27:50 +0000 (16:27 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 30 Nov 2019 11:15:44 +0000 (12:15 +0100)
commit03b5422f041607c1a8af9f7b19eb4616d8471f9c
tree74bb400f2d2865417f9eddf79f5d406e62228b46
parenta0a58e9b8e707c05d2e4e827e378e24c132868d7
Split out BaseTypeFactories

Instantiating BaseTypes with complex definition is a prime example
of where either a builder or a factory pattern is appropriate. Given
we are dealing with a few types with very few customizations, this
patch applies the factory pattern to the problem.

This makes all BaseType subclasses properly immutable and has the
benefit of squashing instances to singletons when they are not
otherwise customized.

Change-Id: I86d09324624c1e5b1a73a0be31269f2233fc15b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/BaseType.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/BaseTypeFactory.java [new file with mode: 0644]
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/BooleanBaseType.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/IntegerBaseType.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/RealBaseType.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/StringBaseType.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/UuidBaseType.java