Feld implements Comparable<Feld>, Cloneable { public static Feld createFeld(final Enum feldX, final FeldInfo info) { try { Constructor<? extends Feld> ctor = info.type().getConstructor(Enum.class, FeldInfo.class); return ctor.newInstance(feldX, info); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException("no constructor " + info.type().getSimpleName() + "(String, FeldInfo) found", ex); } catch (InstantiationException ex) { throw new IllegalArgumentException("can't instantiate " + info.type(), ex); } catch (IllegalAccessException ex) { throw new IllegalArgumentException("can't access ctor for " + info.type(), ex); } catch (InvocationTargetException ex) { throw new IllegalArgumentException("error invoking ctor for " + info.type() + " (" + ex.getTargetException() + ")", ex); } } Feld();  Feld(final Enum feldX);  Feld(final Enum feldX, final FeldInfo info);  Feld(final String name, final String s, final Align alignment);  Feld(final Bezeichner name, final int start, final String s, final Align alignment);  Feld(final Bezeichner bezeichner, final int length, final int start, final Align alignment);  Feld(final String name, final int length, final int start, final char c, final Align alignment);  Feld(final String name, final int length, final int start, final String s, final Align alignment);  Feld(final String name, final int start, final char c);  Feld(final int start, final String s, final Align alignment);  Feld(final int length, final Align alignment);  Feld(final int length, final int start, final Align alignment);  Feld(final Feld other); static Feld createFeld(final Enum feldX, final FeldInfo info); String getBezeichnung(); Bezeichner getBezeichner(); final void setInhalt(final String s); void setInhalt(final int n); void setInhalt(final char c); void setInhalt(final char c, final int i); String getInhalt(); void resetInhalt(); void setAnzahlBytes(final int n); final int getAnzahlBytes(); final int getByteAdresse(); final int getEndAdresse(); final boolean overlapsWith(final Feld other); final void write(final Writer writer); boolean isEmpty(); boolean hasValue(); boolean isValid(); boolean isInvalid(); List<ConstraintViolation> validate(); String format(); @Override String toString(); @Override final boolean equals(final Object obj); @Override final int hashCode(); @Override final int compareTo(final Feld other); static Bezeichner getAsBezeichner(final Enum feldX); static String getAsBezeichnung(final Enum feldX); static String toBezeichnung(final Enum name); @SuppressWarnings("squid:S2975") @Override Object clone(); static final Feld NULL_FELD; }
@Test public void testCreateFeld() { FeldInfo feldInfo = createFeldInfo(); Greeting hello = Greeting.HELLO_WORLD; Feld feld = Feld.createFeld(hello, feldInfo); assertEquals(new Bezeichner("HELLO_WORLD"), feld.getBezeichner()); assertEquals("Hello World", feld.getBezeichnung()); }