kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 01e81a53fd78e3a178021825c342a909d51790e0f1b28b538645055892107c51 |
|---|---|
| Author | Kevin Gallardo <kevin.gallardo@datastax.com> · 2016-02-29 11:27 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-03-01 18:02 +01:00 |
| Parents | 3b30b4f33e7e |
4 files changed
modified clirr-ignores.xml +7 −1
| @@ -46,5 +46,11 @@ | ||
| 46 | 46 | <className>com/datastax/driver/core/ConvictionPolicy$Simple$Factory</className> |
| 47 | 47 | <justification>False positive, the enclosing class is package-private so this was never exposed</justification> |
| 48 | 48 | </difference> |
| 49 | - | |
| 49 | + | |
| 50 | + <difference> | |
| 51 | + <differenceType>1001</differenceType> <!-- decreased visibility --> | |
| 52 | + <className>com/datastax/driver/mapping/ColumnMapper$Kind</className> | |
| 53 | + <justification>False positive, the enclosing class is package-private so this was never exposed</justification> | |
| 54 | + </difference> | |
| 55 | + | |
| 50 | 56 | </differences> |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/ColumnMapper.java +6 −8
| @@ -24,9 +24,7 @@ | ||
| 24 | 24 | |
| 25 | 25 | abstract class ColumnMapper<T> { |
| 26 | 26 | |
| 27 | - public enum Kind {PARTITION_KEY, CLUSTERING_COLUMN, REGULAR, COMPUTED} | |
| 28 | - | |
| 29 | - ; | |
| 27 | + enum Kind {PARTITION_KEY, CLUSTERING_COLUMN, REGULAR, COMPUTED} | |
| 30 | 28 | |
| 31 | 29 | private final String columnName; |
| 32 | 30 | private final String alias; |
| @@ -51,21 +49,21 @@ | ||
| 51 | 49 | this.position = position; |
| 52 | 50 | } |
| 53 | 51 | |
| 54 | - public abstract Object getValue(T entity); | |
| 52 | + abstract Object getValue(T entity); | |
| 55 | 53 | |
| 56 | - public abstract void setValue(T entity, Object value); | |
| 54 | + abstract void setValue(T entity, Object value); | |
| 57 | 55 | |
| 58 | - public String getColumnName() { | |
| 56 | + String getColumnName() { | |
| 59 | 57 | return kind == Kind.COMPUTED |
| 60 | 58 | ? columnName |
| 61 | 59 | : quote(columnName); |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | - public String getAlias() { | |
| 62 | + String getAlias() { | |
| 65 | 63 | return alias; |
| 66 | 64 | } |
| 67 | 65 | |
| 68 | - public DataType getDataType() { | |
| 66 | + DataType getDataType() { | |
| 69 | 67 | return dataType; |
| 70 | 68 | } |
| 71 | 69 |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/EntityMapper.java +14 −14
| @@ -26,16 +26,16 @@ | ||
| 26 | 26 | |
| 27 | 27 | abstract class EntityMapper<T> { |
| 28 | 28 | |
| 29 | - public final Class<T> entityClass; | |
| 29 | + final Class<T> entityClass; | |
| 30 | 30 | private final String keyspace; |
| 31 | 31 | private final String table; |
| 32 | 32 | |
| 33 | - public final ConsistencyLevel writeConsistency; | |
| 34 | - public final ConsistencyLevel readConsistency; | |
| 33 | + final ConsistencyLevel writeConsistency; | |
| 34 | + final ConsistencyLevel readConsistency; | |
| 35 | 35 | |
| 36 | - public final List<ColumnMapper<T>> partitionKeys = new ArrayList<ColumnMapper<T>>(); | |
| 37 | - public final List<ColumnMapper<T>> clusteringColumns = new ArrayList<ColumnMapper<T>>(); | |
| 38 | - public final List<ColumnMapper<T>> regularColumns = new ArrayList<ColumnMapper<T>>(); | |
| 36 | + final List<ColumnMapper<T>> partitionKeys = new ArrayList<ColumnMapper<T>>(); | |
| 37 | + final List<ColumnMapper<T>> clusteringColumns = new ArrayList<ColumnMapper<T>>(); | |
| 38 | + final List<ColumnMapper<T>> regularColumns = new ArrayList<ColumnMapper<T>>(); | |
| 39 | 39 | |
| 40 | 40 | private final List<ColumnMapper<T>> allColumns = new ArrayList<ColumnMapper<T>>(); |
| 41 | 41 | |
| @@ -47,23 +47,23 @@ | ||
| 47 | 47 | this.readConsistency = readConsistency; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - public String getKeyspace() { | |
| 50 | + String getKeyspace() { | |
| 51 | 51 | return quote(keyspace); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public String getTable() { | |
| 54 | + String getTable() { | |
| 55 | 55 | return quote(table); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - public int primaryKeySize() { | |
| 58 | + int primaryKeySize() { | |
| 59 | 59 | return partitionKeys.size() + clusteringColumns.size(); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public ColumnMapper<T> getPrimaryKeyColumn(int i) { | |
| 62 | + ColumnMapper<T> getPrimaryKeyColumn(int i) { | |
| 63 | 63 | return i < partitionKeys.size() ? partitionKeys.get(i) : clusteringColumns.get(i - partitionKeys.size()); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public void addColumns(List<ColumnMapper<T>> pks, List<ColumnMapper<T>> ccs, List<ColumnMapper<T>> rgs) { | |
| 66 | + void addColumns(List<ColumnMapper<T>> pks, List<ColumnMapper<T>> ccs, List<ColumnMapper<T>> rgs) { | |
| 67 | 67 | partitionKeys.addAll(pks); |
| 68 | 68 | allColumns.addAll(pks); |
| 69 | 69 | |
| @@ -73,14 +73,14 @@ | ||
| 73 | 73 | addColumns(rgs); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public void addColumns(List<ColumnMapper<T>> rgs) { | |
| 76 | + void addColumns(List<ColumnMapper<T>> rgs) { | |
| 77 | 77 | regularColumns.addAll(rgs); |
| 78 | 78 | allColumns.addAll(rgs); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - public abstract T newEntity(); | |
| 81 | + abstract T newEntity(); | |
| 82 | 82 | |
| 83 | - public List<ColumnMapper<T>> allColumns() { | |
| 83 | + List<ColumnMapper<T>> allColumns() { | |
| 84 | 84 | return allColumns; |
| 85 | 85 | } |
| 86 | 86 |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/ReflectionMapper.java +4 −4
| @@ -70,7 +70,7 @@ | ||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | @Override |
| 73 | - public Object getValue(T entity) { | |
| 73 | + Object getValue(T entity) { | |
| 74 | 74 | try { |
| 75 | 75 | return toSerializableValue(readMethod.invoke(entity)); |
| 76 | 76 | } catch (IllegalArgumentException e) { |
| @@ -81,7 +81,7 @@ | ||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | @Override |
| 84 | - public void setValue(Object entity, Object value) { | |
| 84 | + void setValue(Object entity, Object value) { | |
| 85 | 85 | try { |
| 86 | 86 | writeMethod.invoke(entity, value); |
| 87 | 87 | } catch (IllegalArgumentException e) { |
| @@ -112,7 +112,7 @@ | ||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | @Override |
| 115 | - public void setValue(Object entity, Object value) { | |
| 115 | + void setValue(Object entity, Object value) { | |
| 116 | 116 | Object converted = null; |
| 117 | 117 | switch (enumType) { |
| 118 | 118 | case STRING: |
| @@ -147,7 +147,7 @@ | ||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | @Override |
| 150 | - public void setValue(Object entity, Object value) { | |
| 150 | + void setValue(Object entity, Object value) { | |
| 151 | 151 | assert value instanceof UDTValue; |
| 152 | 152 | UDTValue udtValue = (UDTValue) value; |
| 153 | 153 | assert udtValue.getType().equals(udtMapper.getUserType()); |