-package net.mograsim.plugin.asm.model;\r
-\r
-import java.util.Objects;\r
-\r
-public final class AsmInstruction implements AsmElement\r
-{\r
- private final AsmOperation operation;\r
- private final AsmOperands operands;\r
-\r
- public AsmInstruction(AsmOperation operation, AsmOperands operands)\r
- {\r
- this.operation = Objects.requireNonNull(operation);\r
- this.operands = Objects.requireNonNull(operands);\r
- }\r
-\r
- @Override\r
- public int hashCode()\r
- {\r
- return Objects.hash(operands, operation);\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj)\r
- {\r
- if (this == obj)\r
- return true;\r
- if (!(obj instanceof AsmInstruction))\r
- return false;\r
- AsmInstruction other = (AsmInstruction) obj;\r
- return Objects.equals(operands, other.operands) && Objects.equals(operation, other.operation);\r
- }\r
-\r
- @Override\r
- public String toString()\r
- {\r
- return String.format("%s %s", operation, operands).trim();\r
- }\r
-\r
-}\r