1 package io.github.robertograham.rleparser.domain; 2 3 import java.util.Objects; 4 5 public class PatternData { 6 7 private final MetaData metaData; 8 private final LiveCells liveCells; 9 10 public PatternData(MetaData metaData, LiveCells liveCells) { 11 this.metaData = metaData; 12 this.liveCells = liveCells; 13 } 14 15 public MetaData getMetaData() { 16 return metaData; 17 } 18 19 public LiveCells getLiveCells() { 20 return liveCells; 21 } 22 23 @Override 24 public String toString() { 25 return "PatternData{" + 26 "metaData=" + metaData + 27 ", liveCells=" + liveCells + 28 '}'; 29 } 30 31 @Override 32 public boolean equals(Object object) { 33 if (this == object) 34 return true; 35 36 if (!(object instanceof PatternData)) 37 return false; 38 39 PatternData patternData = (PatternData) object; 40 41 return Objects.equals(metaData, patternData.metaData) && 42 Objects.equals(liveCells, patternData.liveCells); 43 } 44 45 @Override 46 public int hashCode() { 47 return Objects.hash(metaData, liveCells); 48 } 49 }