ColumnName extends StringTypeValue { public static ColumnName of(String value) { checkNotEmptyOrBlank(value); return new ColumnName(value); } private  ColumnName(String value); static ColumnName of(String value); static ColumnName of(StorageField storageField); static ColumnName of(FieldDeclaration field);  }
@Test @DisplayName("be constructed from string value") void initFromString() { String columnName = "the-column-name"; ColumnName name = ColumnName.of(columnName); assertThat(name.value()).isEqualTo(columnName); }
@SuppressWarnings({"CheckReturnValue", "ResultOfMethodCallIgnored"}) @Test @DisplayName("not be constructed from empty string") void notInitFromEmpty() { assertThrows(IllegalArgumentException.class, () -> ColumnName.of("")); }
@Test @DisplayName("be constructed from `StorageField`") void initFromStorageField() { LifecycleFlagField storageField = LifecycleFlagField.archived; ColumnName name = ColumnName.of(storageField); assertThat(name.value()).isEqualTo(storageField.name()); }
@Test @DisplayName("be constructed from `FieldDeclaration`") void initFromFieldDeclaration() { FieldDescriptor field = TaskView.getDescriptor() .getFields() .get(0); FieldDeclaration fieldDeclaration = new FieldDeclaration(field); ColumnName columnName = ColumnName.of(fieldDeclaration); assertThat(columnName.value()).isEqualTo(field.getName()); }