/org.eclipse.lsp4j.debug/src/main/xtend-gen/org/eclipse/lsp4j/debug/DisassembledInstruction.java

https://github.com/eclipse/lsp4j · Java · 346 lines · 172 code · 31 blank · 143 comment · 60 complexity · fd2decc022b1209c311048ab4a747f9d MD5 · raw file

  1. /**
  2. * Copyright (c) 2017, 2019 Kichwa Coders Ltd. and others.
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Public License v. 2.0 which is available at
  6. * http://www.eclipse.org/legal/epl-2.0,
  7. * or the Eclipse Distribution License v. 1.0 which is available at
  8. * http://www.eclipse.org/org/documents/edl-v10.php.
  9. *
  10. * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
  11. */
  12. package org.eclipse.lsp4j.debug;
  13. import org.eclipse.lsp4j.debug.Source;
  14. import org.eclipse.lsp4j.debug.util.Preconditions;
  15. import org.eclipse.lsp4j.jsonrpc.validation.NonNull;
  16. import org.eclipse.xtext.xbase.lib.Pure;
  17. import org.eclipse.xtext.xbase.lib.util.ToStringBuilder;
  18. /**
  19. * Represents a single disassembled instruction.
  20. */
  21. @SuppressWarnings("all")
  22. public class DisassembledInstruction {
  23. /**
  24. * The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
  25. */
  26. @NonNull
  27. private String address;
  28. /**
  29. * Optional raw bytes representing the instruction and its operands, in an implementation-defined format.
  30. * <p>
  31. * This is an optional property.
  32. */
  33. private String instructionBytes;
  34. /**
  35. * Text representing the instruction and its operands, in an implementation-defined format.
  36. */
  37. @NonNull
  38. private String instruction;
  39. /**
  40. * Name of the symbol that corresponds with the location of this instruction, if any.
  41. * <p>
  42. * This is an optional property.
  43. */
  44. private String symbol;
  45. /**
  46. * Source location that corresponds to this instruction, if any. Should always be set (if available) on the first
  47. * instruction returned, but can be omitted afterwards if this instruction maps to the same source file as the
  48. * previous instruction.
  49. * <p>
  50. * This is an optional property.
  51. */
  52. private Source location;
  53. /**
  54. * The line within the source location that corresponds to this instruction, if any.
  55. * <p>
  56. * This is an optional property.
  57. */
  58. private Integer line;
  59. /**
  60. * The column within the line that corresponds to this instruction, if any.
  61. * <p>
  62. * This is an optional property.
  63. */
  64. private Integer column;
  65. /**
  66. * The end line of the range that corresponds to this instruction, if any.
  67. * <p>
  68. * This is an optional property.
  69. */
  70. private Integer endLine;
  71. /**
  72. * The end column of the range that corresponds to this instruction, if any.
  73. * <p>
  74. * This is an optional property.
  75. */
  76. private Integer endColumn;
  77. /**
  78. * The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
  79. */
  80. @Pure
  81. @NonNull
  82. public String getAddress() {
  83. return this.address;
  84. }
  85. /**
  86. * The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
  87. */
  88. public void setAddress(@NonNull final String address) {
  89. this.address = Preconditions.checkNotNull(address, "address");
  90. }
  91. /**
  92. * Optional raw bytes representing the instruction and its operands, in an implementation-defined format.
  93. * <p>
  94. * This is an optional property.
  95. */
  96. @Pure
  97. public String getInstructionBytes() {
  98. return this.instructionBytes;
  99. }
  100. /**
  101. * Optional raw bytes representing the instruction and its operands, in an implementation-defined format.
  102. * <p>
  103. * This is an optional property.
  104. */
  105. public void setInstructionBytes(final String instructionBytes) {
  106. this.instructionBytes = instructionBytes;
  107. }
  108. /**
  109. * Text representing the instruction and its operands, in an implementation-defined format.
  110. */
  111. @Pure
  112. @NonNull
  113. public String getInstruction() {
  114. return this.instruction;
  115. }
  116. /**
  117. * Text representing the instruction and its operands, in an implementation-defined format.
  118. */
  119. public void setInstruction(@NonNull final String instruction) {
  120. this.instruction = Preconditions.checkNotNull(instruction, "instruction");
  121. }
  122. /**
  123. * Name of the symbol that corresponds with the location of this instruction, if any.
  124. * <p>
  125. * This is an optional property.
  126. */
  127. @Pure
  128. public String getSymbol() {
  129. return this.symbol;
  130. }
  131. /**
  132. * Name of the symbol that corresponds with the location of this instruction, if any.
  133. * <p>
  134. * This is an optional property.
  135. */
  136. public void setSymbol(final String symbol) {
  137. this.symbol = symbol;
  138. }
  139. /**
  140. * Source location that corresponds to this instruction, if any. Should always be set (if available) on the first
  141. * instruction returned, but can be omitted afterwards if this instruction maps to the same source file as the
  142. * previous instruction.
  143. * <p>
  144. * This is an optional property.
  145. */
  146. @Pure
  147. public Source getLocation() {
  148. return this.location;
  149. }
  150. /**
  151. * Source location that corresponds to this instruction, if any. Should always be set (if available) on the first
  152. * instruction returned, but can be omitted afterwards if this instruction maps to the same source file as the
  153. * previous instruction.
  154. * <p>
  155. * This is an optional property.
  156. */
  157. public void setLocation(final Source location) {
  158. this.location = location;
  159. }
  160. /**
  161. * The line within the source location that corresponds to this instruction, if any.
  162. * <p>
  163. * This is an optional property.
  164. */
  165. @Pure
  166. public Integer getLine() {
  167. return this.line;
  168. }
  169. /**
  170. * The line within the source location that corresponds to this instruction, if any.
  171. * <p>
  172. * This is an optional property.
  173. */
  174. public void setLine(final Integer line) {
  175. this.line = line;
  176. }
  177. /**
  178. * The column within the line that corresponds to this instruction, if any.
  179. * <p>
  180. * This is an optional property.
  181. */
  182. @Pure
  183. public Integer getColumn() {
  184. return this.column;
  185. }
  186. /**
  187. * The column within the line that corresponds to this instruction, if any.
  188. * <p>
  189. * This is an optional property.
  190. */
  191. public void setColumn(final Integer column) {
  192. this.column = column;
  193. }
  194. /**
  195. * The end line of the range that corresponds to this instruction, if any.
  196. * <p>
  197. * This is an optional property.
  198. */
  199. @Pure
  200. public Integer getEndLine() {
  201. return this.endLine;
  202. }
  203. /**
  204. * The end line of the range that corresponds to this instruction, if any.
  205. * <p>
  206. * This is an optional property.
  207. */
  208. public void setEndLine(final Integer endLine) {
  209. this.endLine = endLine;
  210. }
  211. /**
  212. * The end column of the range that corresponds to this instruction, if any.
  213. * <p>
  214. * This is an optional property.
  215. */
  216. @Pure
  217. public Integer getEndColumn() {
  218. return this.endColumn;
  219. }
  220. /**
  221. * The end column of the range that corresponds to this instruction, if any.
  222. * <p>
  223. * This is an optional property.
  224. */
  225. public void setEndColumn(final Integer endColumn) {
  226. this.endColumn = endColumn;
  227. }
  228. @Override
  229. @Pure
  230. public String toString() {
  231. ToStringBuilder b = new ToStringBuilder(this);
  232. b.add("address", this.address);
  233. b.add("instructionBytes", this.instructionBytes);
  234. b.add("instruction", this.instruction);
  235. b.add("symbol", this.symbol);
  236. b.add("location", this.location);
  237. b.add("line", this.line);
  238. b.add("column", this.column);
  239. b.add("endLine", this.endLine);
  240. b.add("endColumn", this.endColumn);
  241. return b.toString();
  242. }
  243. @Override
  244. @Pure
  245. public boolean equals(final Object obj) {
  246. if (this == obj)
  247. return true;
  248. if (obj == null)
  249. return false;
  250. if (getClass() != obj.getClass())
  251. return false;
  252. DisassembledInstruction other = (DisassembledInstruction) obj;
  253. if (this.address == null) {
  254. if (other.address != null)
  255. return false;
  256. } else if (!this.address.equals(other.address))
  257. return false;
  258. if (this.instructionBytes == null) {
  259. if (other.instructionBytes != null)
  260. return false;
  261. } else if (!this.instructionBytes.equals(other.instructionBytes))
  262. return false;
  263. if (this.instruction == null) {
  264. if (other.instruction != null)
  265. return false;
  266. } else if (!this.instruction.equals(other.instruction))
  267. return false;
  268. if (this.symbol == null) {
  269. if (other.symbol != null)
  270. return false;
  271. } else if (!this.symbol.equals(other.symbol))
  272. return false;
  273. if (this.location == null) {
  274. if (other.location != null)
  275. return false;
  276. } else if (!this.location.equals(other.location))
  277. return false;
  278. if (this.line == null) {
  279. if (other.line != null)
  280. return false;
  281. } else if (!this.line.equals(other.line))
  282. return false;
  283. if (this.column == null) {
  284. if (other.column != null)
  285. return false;
  286. } else if (!this.column.equals(other.column))
  287. return false;
  288. if (this.endLine == null) {
  289. if (other.endLine != null)
  290. return false;
  291. } else if (!this.endLine.equals(other.endLine))
  292. return false;
  293. if (this.endColumn == null) {
  294. if (other.endColumn != null)
  295. return false;
  296. } else if (!this.endColumn.equals(other.endColumn))
  297. return false;
  298. return true;
  299. }
  300. @Override
  301. @Pure
  302. public int hashCode() {
  303. final int prime = 31;
  304. int result = 1;
  305. result = prime * result + ((this.address== null) ? 0 : this.address.hashCode());
  306. result = prime * result + ((this.instructionBytes== null) ? 0 : this.instructionBytes.hashCode());
  307. result = prime * result + ((this.instruction== null) ? 0 : this.instruction.hashCode());
  308. result = prime * result + ((this.symbol== null) ? 0 : this.symbol.hashCode());
  309. result = prime * result + ((this.location== null) ? 0 : this.location.hashCode());
  310. result = prime * result + ((this.line== null) ? 0 : this.line.hashCode());
  311. result = prime * result + ((this.column== null) ? 0 : this.column.hashCode());
  312. result = prime * result + ((this.endLine== null) ? 0 : this.endLine.hashCode());
  313. return prime * result + ((this.endColumn== null) ? 0 : this.endColumn.hashCode());
  314. }
  315. }