@Test public void equalsTest() { DisplayModel displayModel1 = new DisplayModel(); DisplayModel displayModel2 = new DisplayModel(); DisplayModel displayModel3 = new DisplayModel(); displayModel3.setBackgroundColor(0xffff0000); DisplayModel displayModel4 = new DisplayModel(); displayModel4.setFixedTileSize(512); DisplayModel displayModel5 = new DisplayModel(); displayModel5.setMaxTextWidthFactor(0.5f); DisplayModel displayModel6 = new DisplayModel(); displayModel6.setTileSizeMultiple(200); DisplayModel displayModel7 = new DisplayModel(); displayModel7.setUserScaleFactor(0.3f); TestUtils.equalsTest(displayModel1, displayModel2); TestUtils.notEqualsTest(displayModel1, displayModel3); TestUtils.notEqualsTest(displayModel1, displayModel4); TestUtils.notEqualsTest(displayModel1, displayModel5); TestUtils.notEqualsTest(displayModel1, displayModel6); TestUtils.notEqualsTest(displayModel1, displayModel7); TestUtils.notEqualsTest(displayModel1, new Object()); TestUtils.notEqualsTest(displayModel1, null); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof DisplayModel)) return false; DisplayModel other = (DisplayModel) obj; if (this.backgroundColor != other.backgroundColor) return false; if (this.filter != other.filter) return false; if (this.fixedTileSize != other.fixedTileSize) return false; if (this.maxTextWidth != other.maxTextWidth) return false; if (Float.floatToIntBits(this.maxTextWidthFactor) != Float.floatToIntBits(other.maxTextWidthFactor)) return false; if (this.tileSize != other.tileSize) return false; if (this.tileSizeMultiple != other.tileSizeMultiple) return false; if (Float.floatToIntBits(this.userScaleFactor) != Float.floatToIntBits(other.userScaleFactor)) return false; return true; }
DisplayModel extends Observable { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof DisplayModel)) return false; DisplayModel other = (DisplayModel) obj; if (this.backgroundColor != other.backgroundColor) return false; if (this.filter != other.filter) return false; if (this.fixedTileSize != other.fixedTileSize) return false; if (this.maxTextWidth != other.maxTextWidth) return false; if (Float.floatToIntBits(this.maxTextWidthFactor) != Float.floatToIntBits(other.maxTextWidthFactor)) return false; if (this.tileSize != other.tileSize) return false; if (this.tileSizeMultiple != other.tileSizeMultiple) return false; if (Float.floatToIntBits(this.userScaleFactor) != Float.floatToIntBits(other.userScaleFactor)) return false; return true; } }
DisplayModel extends Observable { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof DisplayModel)) return false; DisplayModel other = (DisplayModel) obj; if (this.backgroundColor != other.backgroundColor) return false; if (this.filter != other.filter) return false; if (this.fixedTileSize != other.fixedTileSize) return false; if (this.maxTextWidth != other.maxTextWidth) return false; if (Float.floatToIntBits(this.maxTextWidthFactor) != Float.floatToIntBits(other.maxTextWidthFactor)) return false; if (this.tileSize != other.tileSize) return false; if (this.tileSizeMultiple != other.tileSizeMultiple) return false; if (Float.floatToIntBits(this.userScaleFactor) != Float.floatToIntBits(other.userScaleFactor)) return false; return true; } DisplayModel(); }
DisplayModel extends Observable { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof DisplayModel)) return false; DisplayModel other = (DisplayModel) obj; if (this.backgroundColor != other.backgroundColor) return false; if (this.filter != other.filter) return false; if (this.fixedTileSize != other.fixedTileSize) return false; if (this.maxTextWidth != other.maxTextWidth) return false; if (Float.floatToIntBits(this.maxTextWidthFactor) != Float.floatToIntBits(other.maxTextWidthFactor)) return false; if (this.tileSize != other.tileSize) return false; if (this.tileSizeMultiple != other.tileSizeMultiple) return false; if (Float.floatToIntBits(this.userScaleFactor) != Float.floatToIntBits(other.userScaleFactor)) return false; return true; } DisplayModel(); static synchronized float getDefaultUserScaleFactor(); static synchronized float getDeviceScaleFactor(); static synchronized void setDefaultUserScaleFactor(float scaleFactor); static synchronized void setDeviceScaleFactor(float scaleFactor); @Override boolean equals(Object obj); synchronized int getBackgroundColor(); synchronized Filter getFilter(); int getMaxTextWidth(); synchronized float getScaleFactor(); synchronized ThemeCallback getThemeCallback(); synchronized int getTileSize(); synchronized int getTileSizeMultiple(); synchronized float getUserScaleFactor(); @Override int hashCode(); synchronized void setBackgroundColor(int color); synchronized void setFilter(Filter filter); void setFixedTileSize(int tileSize); void setMaxTextWidthFactor(float maxTextWidthFactor); synchronized void setThemeCallback(ThemeCallback themeCallback); synchronized void setTileSizeMultiple(int multiple); synchronized void setUserScaleFactor(float scaleFactor); }
DisplayModel extends Observable { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof DisplayModel)) return false; DisplayModel other = (DisplayModel) obj; if (this.backgroundColor != other.backgroundColor) return false; if (this.filter != other.filter) return false; if (this.fixedTileSize != other.fixedTileSize) return false; if (this.maxTextWidth != other.maxTextWidth) return false; if (Float.floatToIntBits(this.maxTextWidthFactor) != Float.floatToIntBits(other.maxTextWidthFactor)) return false; if (this.tileSize != other.tileSize) return false; if (this.tileSizeMultiple != other.tileSizeMultiple) return false; if (Float.floatToIntBits(this.userScaleFactor) != Float.floatToIntBits(other.userScaleFactor)) return false; return true; } DisplayModel(); static synchronized float getDefaultUserScaleFactor(); static synchronized float getDeviceScaleFactor(); static synchronized void setDefaultUserScaleFactor(float scaleFactor); static synchronized void setDeviceScaleFactor(float scaleFactor); @Override boolean equals(Object obj); synchronized int getBackgroundColor(); synchronized Filter getFilter(); int getMaxTextWidth(); synchronized float getScaleFactor(); synchronized ThemeCallback getThemeCallback(); synchronized int getTileSize(); synchronized int getTileSizeMultiple(); synchronized float getUserScaleFactor(); @Override int hashCode(); synchronized void setBackgroundColor(int color); synchronized void setFilter(Filter filter); void setFixedTileSize(int tileSize); void setMaxTextWidthFactor(float maxTextWidthFactor); synchronized void setThemeCallback(ThemeCallback themeCallback); synchronized void setTileSizeMultiple(int multiple); synchronized void setUserScaleFactor(float scaleFactor);  }