Skip to content

Commit b455e1c

Browse files
mattdickinson5jenkins
authored andcommitted
Revert "scrooge-generator: provide copyWith methods on structs"
Summary: This reverts commit fdf3e67132dd5df5534a713e8ba716aea5bc2298. Differential Revision: https://phabricator.twitter.biz/D1047018
1 parent 39542d5 commit b455e1c

File tree

12 files changed

+0
-130
lines changed

12 files changed

+0
-130
lines changed

CHANGELOG.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ Note that ``PHAB_ID=#`` and ``RB_ID=#`` correspond to associated messages in com
77
Unreleased
88
----------
99

10-
New Features
11-
~~~~~~~~~~~~
12-
13-
* scrooge-generator: Provide `$STRUCT#copyWith$FIELDNAME` methods to set single fields on
14-
Thrift structs ``PHAB_ID=D1040974``
15-
1610
22.12.0
1711
-------
1812

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/AnotherException.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,6 @@ class AnotherException(
320320
_passthroughFields
321321
)
322322

323-
def copyWithErrorCode(value: Int): AnotherException =
324-
this.copy(errorCode = value)
325-
326-
327323
override def canEqual(other: Any): Boolean = other.isInstanceOf[AnotherException]
328324

329325
private[this] def _equals(other: AnotherException): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/CollectionId.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ trait CollectionId
425425
_passthroughFields
426426
)
427427

428-
def copyWithCollectionLongId(value: Long): CollectionId =
429-
this.copy(collectionLongId = value)
430-
431-
432428
override def canEqual(other: Any): Boolean = other.isInstanceOf[CollectionId]
433429

434430
private[this] def _equals(other: CollectionId): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/GoldService.scala

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -570,16 +570,6 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ
570570
_passthroughFields
571571
)
572572

573-
def copyWithRequest(value: com.twitter.scrooge.test.gold.thriftscala.Request): Args =
574-
this.copy(request = value)
575-
576-
def copyWithUnionRequest(value: com.twitter.scrooge.test.gold.thriftscala.RequestUnion): Args =
577-
this.copy(unionRequest = value)
578-
579-
def copyWithExceptionRequest(value: com.twitter.scrooge.test.gold.thriftscala.RequestException): Args =
580-
this.copy(exceptionRequest = value)
581-
582-
583573
override def canEqual(other: Any): Boolean = other.isInstanceOf[Args]
584574

585575
private[this] def _equals(other: Args): Boolean =
@@ -879,13 +869,6 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ
879869
_passthroughFields
880870
)
881871

882-
def copyWithSuccess(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Response]): Result =
883-
this.copy(success = value)
884-
885-
def copyWithEx(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.OverCapacityException]): Result =
886-
this.copy(ex = value)
887-
888-
889872
override def canEqual(other: Any): Boolean = other.isInstanceOf[Result]
890873

891874
private[this] def _equals(other: Result): Boolean =
@@ -1158,10 +1141,6 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ
11581141
_passthroughFields
11591142
)
11601143

1161-
def copyWithRequest(value: com.twitter.scrooge.test.gold.thriftscala.Request): Args =
1162-
this.copy(request = value)
1163-
1164-
11651144
override def canEqual(other: Any): Boolean = other.isInstanceOf[Args]
11661145

11671146
private[this] def _equals(other: Args): Boolean =
@@ -1401,10 +1380,6 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ
14011380
_passthroughFields
14021381
)
14031382

1404-
def copyWithSuccess(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Response]): Result =
1405-
this.copy(success = value)
1406-
1407-
14081383
override def canEqual(other: Any): Boolean = other.isInstanceOf[Result]
14091384

14101385
private[this] def _equals(other: Result): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/OverCapacityException.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,6 @@ class OverCapacityException(
324324
_passthroughFields
325325
)
326326

327-
def copyWithChillTimeSeconds(value: Int): OverCapacityException =
328-
this.copy(chillTimeSeconds = value)
329-
330-
331327
override def canEqual(other: Any): Boolean = other.isInstanceOf[OverCapacityException]
332328

333329
private[this] def _equals(other: OverCapacityException): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/PlatinumService.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,6 @@ object PlatinumService extends _root_.com.twitter.finagle.thrift.GeneratedThrift
502502
_passthroughFields
503503
)
504504

505-
def copyWithRequest(value: com.twitter.scrooge.test.gold.thriftscala.Request): Args =
506-
this.copy(request = value)
507-
508-
509505
override def canEqual(other: Any): Boolean = other.isInstanceOf[Args]
510506

511507
private[this] def _equals(other: Args): Boolean =
@@ -846,16 +842,6 @@ object PlatinumService extends _root_.com.twitter.finagle.thrift.GeneratedThrift
846842
_passthroughFields
847843
)
848844

849-
def copyWithSuccess(value: _root_.scala.Option[Int]): Result =
850-
this.copy(success = value)
851-
852-
def copyWithAx(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.AnotherException]): Result =
853-
this.copy(ax = value)
854-
855-
def copyWithOce(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.OverCapacityException]): Result =
856-
this.copy(oce = value)
857-
858-
859845
override def canEqual(other: Any): Boolean = other.isInstanceOf[Result]
860846

861847
private[this] def _equals(other: Result): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Recursive.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,6 @@ trait Recursive
503503
_passthroughFields
504504
)
505505

506-
def copyWithId(value: Long): Recursive =
507-
this.copy(id = value)
508-
509-
def copyWithRecRequest(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Request]): Recursive =
510-
this.copy(recRequest = value)
511-
512-
513506
override def canEqual(other: Any): Boolean = other.isInstanceOf[Recursive]
514507

515508
private[this] def _equals(other: Recursive): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Request.scala

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,52 +1751,6 @@ trait Request
17511751
_passthroughFields
17521752
)
17531753

1754-
def copyWithAList(value: _root_.scala.collection.Seq[String]): Request =
1755-
this.copy(aList = value)
1756-
1757-
def copyWithASet(value: _root_.scala.collection.Set[Int]): Request =
1758-
this.copy(aSet = value)
1759-
1760-
def copyWithAMap(value: _root_.scala.collection.Map[Long, Long]): Request =
1761-
this.copy(aMap = value)
1762-
1763-
def copyWithARequest(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Request]): Request =
1764-
this.copy(aRequest = value)
1765-
1766-
def copyWithSubRequests(value: _root_.scala.collection.Seq[com.twitter.scrooge.test.gold.thriftscala.Request]): Request =
1767-
this.copy(subRequests = value)
1768-
1769-
def copyWith_Default(value: String): Request =
1770-
this.copy(_default = value)
1771-
1772-
def copyWithNoComment(value: _root_.scala.Option[Long]): Request =
1773-
this.copy(noComment = value)
1774-
1775-
def copyWithDoubleSlashComment(value: _root_.scala.Option[Long]): Request =
1776-
this.copy(doubleSlashComment = value)
1777-
1778-
def copyWithHashtagComment(value: _root_.scala.Option[Long]): Request =
1779-
this.copy(hashtagComment = value)
1780-
1781-
def copyWithSingleAsteriskComment(value: _root_.scala.Option[Long]): Request =
1782-
this.copy(singleAsteriskComment = value)
1783-
1784-
def copyWithDocStringComment(value: _root_.scala.Option[Long]): Request =
1785-
this.copy(docStringComment = value)
1786-
1787-
def copyWithRecRequest(value: _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Recursive]): Request =
1788-
this.copy(recRequest = value)
1789-
1790-
def copyWithRequiredField(value: String): Request =
1791-
this.copy(requiredField = value)
1792-
1793-
def copyWithAnInt8(value: _root_.scala.Option[Byte]): Request =
1794-
this.copy(anInt8 = value)
1795-
1796-
def copyWithABinaryField(value: _root_.scala.Option[_root_.java.nio.ByteBuffer]): Request =
1797-
this.copy(aBinaryField = value)
1798-
1799-
18001754
/**
18011755
* Construction required fields need a different copy API than all the other fields. If a Some
18021756
* argument is provided, then that value will change. None arguments mean that there is no change

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/RequestException.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,6 @@ class RequestException(
328328
_passthroughFields
329329
)
330330

331-
def copyWithMessage(value: String): RequestException =
332-
this.copy(message = value)
333-
334-
335331
override def canEqual(other: Any): Boolean = other.isInstanceOf[RequestException]
336332

337333
private[this] def _equals(other: RequestException): Boolean =

scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Response.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,6 @@ trait Response
514514
_passthroughFields
515515
)
516516

517-
def copyWithStatusCode(value: Int): Response =
518-
this.copy(statusCode = value)
519-
520-
def copyWithResponseUnion(value: com.twitter.scrooge.test.gold.thriftscala.ResponseUnion): Response =
521-
this.copy(responseUnion = value)
522-
523-
524517
override def canEqual(other: Any): Boolean = other.isInstanceOf[Response]
525518

526519
private[this] def _equals(other: Response): Boolean =

0 commit comments

Comments
 (0)