PropInfo { @NotNull public TextValue getTextValue() throws RepositoryException { if (multipleStatus == MultipleStatus.MULTIPLE) { throw new RepositoryException("Multiple import values with single-valued property definition"); } return values.get(0); } PropInfo(@Nullable String name, int type, @NotNull TextValue value);  PropInfo(@Nullable String name, int type, @NotNull List<? extends TextValue> values);  PropInfo(@Nullable String name, int type,
                    @NotNull List<? extends TextValue> values,
                    @NotNull MultipleStatus multipleStatus); void dispose(); int getTargetType(PropertyDefinition def); @Nullable String getName(); int getType(); boolean isUnknownMultiple(); @NotNull TextValue getTextValue(); @NotNull List<? extends TextValue> getTextValues(); @NotNull Value getValue(int targetType); @NotNull List<Value> getValues(int targetType); PropertyState asPropertyState(@NotNull PropertyDefinition propertyDefinition);  }
@Test public void testGetTextValueSingle() throws Exception { TextValue tv = mockTextValue("value", PropertyType.STRING); PropInfo propInfo = new PropInfo("string", PropertyType.STRING, tv); assertEquals(tv, propInfo.getTextValue()); }
@Test public void testGetTextValueSingleList() throws Exception { TextValue tv = mockTextValue("value", PropertyType.STRING); PropInfo propInfo = new PropInfo("string", PropertyType.STRING, ImmutableList.of(tv)); assertEquals(tv, propInfo.getTextValue()); }
@Test(expected = RepositoryException.class) public void testGetTextValueMultiple() throws Exception { List<TextValue> tvs = ImmutableList.of(mockTextValue("24", PropertyType.LONG), mockTextValue("35", PropertyType.LONG)); PropInfo propInfo = new PropInfo("longs", PropertyType.LONG, tvs); propInfo.getTextValue(); }