Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Objects;
- public class StateSymbol {
- private String state;
- private char symbol;
- public StateSymbol(String state, char symbol) {
- this.state = state;
- this.symbol = symbol;
- }
- public String getState() {
- return state;
- }
- public char getSymbol() {
- return symbol;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- StateSymbol that = (StateSymbol) o;
- return symbol == that.symbol && Objects.equals(state, that.state);
- }
- @Override
- public int hashCode() {
- return Objects.hash(state, symbol);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment