Skip to content

Commit

Permalink
fix: revert change to java record (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjhughes committed Mar 26, 2024
1 parent cdede8d commit 252ef20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
package com.reactnativecommunity.picker;

public record ReactPickerLocalData(int height) {
public class ReactPickerLocalData {
private final int height;

public ReactPickerLocalData(int height) {
this.height = height;
}

public int getHeight() {
return height;
}

@Override
public boolean equals(Object o) {
Expand All @@ -10,6 +19,11 @@ public boolean equals(Object o) {
return height == that.height;
}

@Override
public int hashCode() {
return 31 + height;
}

@Override
public String toString() {
return "RectPickerLocalData{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public class ReactPickerShadowNode extends LayoutShadowNode {
@Override
public void setLocalData(Object data) {
Assertions.assertCondition(data instanceof ReactPickerLocalData);
setStyleMinHeight(((ReactPickerLocalData) data).height());
setStyleMinHeight(((ReactPickerLocalData) data).getHeight());
}
}

0 comments on commit 252ef20

Please sign in to comment.