Elffuss BraidHub

kikocis/java-driver public

Clarify meaning of fields in AnnotationParser.
Changeset37e876ef1735c4552f632e583dec051d4c5180a84709ea8b8df5563370891ee8
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2016-07-12 11:26 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2016-07-22 09:47 -07:00
Parentsa7a8be09fd1a

Browse the files at this changeset

1 file changed

modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java +9 −6
@@ -22,7 +22,6 @@
2222 import com.datastax.driver.core.UserType;
2323 import com.datastax.driver.mapping.MethodMapper.ParamMapper;
2424 import com.datastax.driver.mapping.annotations.*;
25-import com.google.common.annotations.VisibleForTesting;
2625 import com.google.common.base.Strings;
2726 import com.google.common.collect.ImmutableSet;
2827 import com.google.common.reflect.TypeToken;
@@ -44,8 +43,10 @@
4443 @SuppressWarnings({"unchecked", "WeakerAccess"})
4544 class AnnotationParser {
4645
47- @VisibleForTesting
48- static final Set<Class<? extends Annotation>> VALID_PROPERTY_ANNOTATIONS = ImmutableSet.of(
46+ /**
47+ * Annotations allowed on a property that maps to a table column.
48+ */
49+ private static final Set<Class<? extends Annotation>> VALID_COLUMN_ANNOTATIONS = ImmutableSet.of(
4950 Column.class,
5051 Computed.class,
5152 ClusteringColumn.class,
@@ -55,8 +56,10 @@
5556 PartitionKey.class,
5657 Transient.class);
5758
58- @VisibleForTesting
59- static final Set<Class<? extends Annotation>> VALID_FIELD_ANNOTATIONS = ImmutableSet.of(
59+ /**
60+ * Annotations allowed on a property that maps to a UDT field.
61+ */
62+ private static final Set<Class<? extends Annotation>> VALID_FIELD_ANNOTATIONS = ImmutableSet.of(
6063 Field.class,
6164 Frozen.class,
6265 FrozenKey.class,
@@ -119,7 +122,7 @@
119122 if (mappingManager.isCassandraV1 && propertyMapper.isComputed())
120123 throw new UnsupportedOperationException("Computed properties are not supported with native protocol v1");
121124
122- AnnotationChecks.validateAnnotations(propertyMapper, VALID_PROPERTY_ANNOTATIONS);
125+ AnnotationChecks.validateAnnotations(propertyMapper, VALID_COLUMN_ANNOTATIONS);
123126
124127 if (propertyMapper.isTransient())
125128 continue;