@Test public void testDimensionToString_unknownAttribute() throws Exception { ProductBrand productBrand = mock(ProductBrand.class); when(productBrand.getValue()).thenThrow(new RuntimeException()); assertThat("ProductPartitionNode did not fail gracefully when interpreting the attributes of " + "a malformed ProductDimension", ProductPartitionNode.toString(productBrand), Matchers.containsString("UNKNOWN")); }
@Override public String toString() { Long parentPartitionId = getParent() != null ? getParent().getProductPartitionId() : null; return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("dimension", toString(dimension)) .append("partitionId", partitionId) .append("parentPartitionId", parentPartitionId) .append("nodeType", nodeState.getNodeType()) .append("bidMicros", getBid()) .append("hasChildren", hasChildren()) .append("trackingUrlTemplate", getTrackingUrlTemplate()) .append("customParameters", nodeState.getCustomParams()) .toString(); }
ProductPartitionNode { @Override public String toString() { Long parentPartitionId = getParent() != null ? getParent().getProductPartitionId() : null; return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("dimension", toString(dimension)) .append("partitionId", partitionId) .append("parentPartitionId", parentPartitionId) .append("nodeType", nodeState.getNodeType()) .append("bidMicros", getBid()) .append("hasChildren", hasChildren()) .append("trackingUrlTemplate", getTrackingUrlTemplate()) .append("customParameters", nodeState.getCustomParams()) .toString(); } }
ProductPartitionNode { @Override public String toString() { Long parentPartitionId = getParent() != null ? getParent().getProductPartitionId() : null; return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("dimension", toString(dimension)) .append("partitionId", partitionId) .append("parentPartitionId", parentPartitionId) .append("nodeType", nodeState.getNodeType()) .append("bidMicros", getBid()) .append("hasChildren", hasChildren()) .append("trackingUrlTemplate", getTrackingUrlTemplate()) .append("customParameters", nodeState.getCustomParams()) .toString(); } ProductPartitionNode(@Nullable ProductPartitionNode parentNode,
      @Nullable ProductDimension dimension, @Nullable Long partitionId,
      Comparator<? super ProductDimension> comparator); }
ProductPartitionNode { @Override public String toString() { Long parentPartitionId = getParent() != null ? getParent().getProductPartitionId() : null; return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("dimension", toString(dimension)) .append("partitionId", partitionId) .append("parentPartitionId", parentPartitionId) .append("nodeType", nodeState.getNodeType()) .append("bidMicros", getBid()) .append("hasChildren", hasChildren()) .append("trackingUrlTemplate", getTrackingUrlTemplate()) .append("customParameters", nodeState.getCustomParams()) .toString(); } ProductPartitionNode(@Nullable ProductPartitionNode parentNode,
      @Nullable ProductDimension dimension, @Nullable Long partitionId,
      Comparator<? super ProductDimension> comparator); ProductDimension getDimension(); @Nullable Long getProductPartitionId(); boolean isSubdivision(); boolean isUnit(); ProductPartitionNode asSubdivision(); Iterable<ProductPartitionNode> getChildren(); ProductPartitionNode getChild(ProductDimension dimension); boolean hasChild(ProductDimension dimension); @Nullable Long getBid(); boolean isBiddableUnit(); boolean isExcludedUnit(); @Override String toString(); String toDetailedString(); static String toString(ProductDimension dimension); ProductPartitionNode getParent(); ProductPartitionNode addChild(ProductDimension childDimension); ProductPartitionNode removeChild(ProductDimension childDimension); ProductPartitionNode removeAllChildren(); ProductPartitionNode asExcludedUnit(); ProductPartitionNode asBiddableUnit(); ProductPartitionNode setBid(@Nullable Long bidInMicros); @Nullable String getTrackingUrlTemplate(); ProductPartitionNode setTrackingUrlTemplate(String trackingUrlTemplate); ProductPartitionNode putCustomParameter(String key, String value); @Nullable String getCustomParameter(String key); ImmutableMap<String, String> getCustomParameters(); ProductPartitionNode removeCustomParameter(String key); }
ProductPartitionNode { @Override public String toString() { Long parentPartitionId = getParent() != null ? getParent().getProductPartitionId() : null; return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("dimension", toString(dimension)) .append("partitionId", partitionId) .append("parentPartitionId", parentPartitionId) .append("nodeType", nodeState.getNodeType()) .append("bidMicros", getBid()) .append("hasChildren", hasChildren()) .append("trackingUrlTemplate", getTrackingUrlTemplate()) .append("customParameters", nodeState.getCustomParams()) .toString(); } ProductPartitionNode(@Nullable ProductPartitionNode parentNode,
      @Nullable ProductDimension dimension, @Nullable Long partitionId,
      Comparator<? super ProductDimension> comparator); ProductDimension getDimension(); @Nullable Long getProductPartitionId(); boolean isSubdivision(); boolean isUnit(); ProductPartitionNode asSubdivision(); Iterable<ProductPartitionNode> getChildren(); ProductPartitionNode getChild(ProductDimension dimension); boolean hasChild(ProductDimension dimension); @Nullable Long getBid(); boolean isBiddableUnit(); boolean isExcludedUnit(); @Override String toString(); String toDetailedString(); static String toString(ProductDimension dimension); ProductPartitionNode getParent(); ProductPartitionNode addChild(ProductDimension childDimension); ProductPartitionNode removeChild(ProductDimension childDimension); ProductPartitionNode removeAllChildren(); ProductPartitionNode asExcludedUnit(); ProductPartitionNode asBiddableUnit(); ProductPartitionNode setBid(@Nullable Long bidInMicros); @Nullable String getTrackingUrlTemplate(); ProductPartitionNode setTrackingUrlTemplate(String trackingUrlTemplate); ProductPartitionNode putCustomParameter(String key, String value); @Nullable String getCustomParameter(String key); ImmutableMap<String, String> getCustomParameters(); ProductPartitionNode removeCustomParameter(String key);  }