File tree Expand file tree Collapse file tree
litho-editor-core/src/main/java/com/facebook/litho/editor/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717package com.facebook.litho.editor.model
1818
19- /* * Wraps over a boolean to make it an EditorValue */
20- class EditorBool (@JvmField val value : Boolean ) : EditorValue() {
21-
22- override fun equals (o : Any? ): Boolean {
23- if (o == = this ) {
24- return true
25- }
26- if (o !is EditorBool ) {
27- return false
28- }
29- val thisValue: Any = this .value
30- val otherValue: Any = o.value
31- return thisValue == otherValue
32- }
33-
34- override fun hashCode (): Int {
35- val PRIME = 59
36- var result = 1
37- val objValue: Any = this .value
38- result = result * PRIME + objValue.hashCode()
39- return result
40- }
19+ import com.facebook.kotlin.compilerplugins.dataclassgenerate.annotation.DataClassGenerate
4120
21+ /* * Wraps over a boolean to make it an EditorValue */
22+ @DataClassGenerate
23+ data class EditorBool (@JvmField val value : Boolean ) : EditorValue() {
4224 override fun toString (): String {
4325 return value.toString()
4426 }
Original file line number Diff line number Diff line change 1616
1717package com.facebook.litho.editor.model
1818
19- /* * Wraps over a color to make it an EditorValue */
20- class EditorColor (@JvmField val value : Number ) : EditorValue() {
21-
22- override fun equals (o : Any? ): Boolean {
23- if (this == = o) {
24- return true
25- }
26-
27- if (o == null || javaClass != o.javaClass) {
28- return false
29- }
30-
31- val that = o as EditorColor
32-
33- return value == that.value
34- }
35-
36- override fun hashCode (): Int {
37- return value.hashCode()
38- }
19+ import com.facebook.kotlin.compilerplugins.dataclassgenerate.annotation.DataClassGenerate
3920
21+ /* * Wraps over a color to make it an EditorValue */
22+ @DataClassGenerate
23+ data class EditorColor (@JvmField val value : Number ) : EditorValue() {
4024 override fun toString (): String {
4125 return value.toString()
4226 }
Original file line number Diff line number Diff line change 1616
1717package com.facebook.litho.editor.model
1818
19- /* * Wraps over a number to make it an EditorValue */
20- class EditorNumber (@JvmField val value : Number ) : EditorValue() {
21- override fun equals (o : Any? ): Boolean {
22- if (this == = o) {
23- return true
24- }
25-
26- if (o == null || javaClass != o.javaClass) {
27- return false
28- }
29-
30- val that = o as EditorNumber
31-
32- return value == that.value
33- }
34-
35- override fun hashCode (): Int {
36- return value.hashCode()
37- }
19+ import com.facebook.kotlin.compilerplugins.dataclassgenerate.annotation.DataClassGenerate
3820
21+ /* * Wraps over a number to make it an EditorValue */
22+ @DataClassGenerate
23+ data class EditorNumber (@JvmField val value : Number ) : EditorValue() {
3924 override fun toString (): String {
4025 return value.toString()
4126 }
Original file line number Diff line number Diff line change 1616
1717package com.facebook.litho.editor.model
1818
19- /* * Wraps over a shape to make it an EditorValue */
20- class EditorShape (@JvmField val value : Map <String , EditorValue >) : EditorValue() {
21- override fun equals (o : Any? ): Boolean {
22- if (o == = this ) {
23- return true
24- }
25- if (o !is EditorShape ) {
26- return false
27- }
28- val thisValue: Any = this .value
29- val otherValue: Any = o.value
30- return thisValue == otherValue
31- }
32-
33- override fun hashCode (): Int {
34- val PRIME = 59
35- var result = 1
36- val objValue: Any = this .value
37- result = result * PRIME + objValue.hashCode()
38- return result
39- }
19+ import com.facebook.kotlin.compilerplugins.dataclassgenerate.annotation.DataClassGenerate
4020
21+ /* * Wraps over a shape to make it an EditorValue */
22+ @DataClassGenerate
23+ data class EditorShape (@JvmField val value : Map <String , EditorValue >) : EditorValue() {
4124 override fun toString (): String {
4225 return value.toString()
4326 }
Original file line number Diff line number Diff line change 1616
1717package com.facebook.litho.editor.model
1818
19- /* * Wraps over a String to make it an EditorValue */
20- class EditorString (@JvmField val value : String ) : EditorValue() {
21- override fun equals (o : Any? ): Boolean {
22- if (o == = this ) {
23- return true
24- }
25- if (o !is EditorString ) {
26- return false
27- }
28- val thisValue: Any = this .value
29- val otherValue: Any = o.value
30- return thisValue == otherValue
31- }
32-
33- override fun hashCode (): Int {
34- val PRIME = 59
35- var result = 1
36- val objValue: Any = this .value
37- result = result * PRIME + objValue.hashCode()
38- return result
39- }
19+ import com.facebook.kotlin.compilerplugins.dataclassgenerate.annotation.DataClassGenerate
4020
21+ /* * Wraps over a String to make it an EditorValue */
22+ @DataClassGenerate
23+ data class EditorString (@JvmField val value : String ) : EditorValue() {
4124 override fun toString (): String {
4225 return value
4326 }
You can’t perform that action at this time.
0 commit comments