/** * This is used only for serializing * * @param name * @param props */ public BaseDimAttribute(String name, Map<String, String> props) { super(name, props); this.type = getDimType(name, props); this.numOfDistinctValues = getDimNumOfDistinctValues(name, props); this.values = getValues(name, props); }
/** * This is used only for serializing * * @param name * @param props */ public BaseDimAttribute(String name, Map<String, String> props) { super(name, props); this.type = getDimType(name, props); this.numOfDistinctValues = getDimNumOfDistinctValues(name, props); this.values = getValues(name, props); }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } BaseDimAttribute other = (BaseDimAttribute) obj; if (this.getType() == null) { if (other.getType() != null) { return false; } } else if (!this.getType().equalsIgnoreCase(other.getType())) { return false; } else if (!this.numOfDistinctValues.equals(other.numOfDistinctValues)) { return false; } else if (!this.getValues().equals(other.getValues())) { return false; } return true; } }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } BaseDimAttribute other = (BaseDimAttribute) obj; if (this.getType() == null) { if (other.getType() != null) { return false; } } else if (!this.getType().equalsIgnoreCase(other.getType())) { return false; } else if (!this.numOfDistinctValues.equals(other.numOfDistinctValues)) { return false; } else if (!this.getValues().equals(other.getValues())) { return false; } return true; } }
assertEquals(col3.getDisplayString(), "Column3"); assertEquals(col3.getType(), "string"); assertEquals(col3.getValues().get().get(0), "Val1"); assertEquals(col3.getValues().get().get(1), "Val2"); assertEquals(col3.getValues().get().get(2), "Val3"); assertEquals(col3.getNumOfDistinctValues().get(), (Long) 3L); assertNotNull(dim.getAttributeByName("col4")); assertEquals(col4h1.getDescription(), "inline column"); assertEquals(col4h1.getDisplayString(), "Column4-h1"); assertEquals(col4h1.getValues().get().get(0), "Val1-h1"); assertEquals(col4h1.getValues().get().get(1), "Val2-h1"); assertEquals(col4h1.getValues().get().get(2), "Val3-h1"); assertEquals(col4h1.getNumOfDistinctValues().get(), (Long) 3L); BaseDimAttribute col4h2 = (BaseDimAttribute) col4.getHierarchy().get(1);