All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lnrpc.AliasMap.scala Maven / Gradle / Ivy

The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package lnrpc
import org.bitcoins.lnd.rpc.LndUtils._

/** @param baseScid
  *  
  *  For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is
  *  the first assigned "base" alias.
  * @param aliases
  *   The set of all aliases stored for the base SCID.
  */
@SerialVersionUID(0L)
final case class AliasMap(
    baseScid: org.bitcoins.core.number.UInt64 = lnrpc.AliasMap._typemapper_baseScid.toCustom(0L),
    aliases: _root_.scala.Seq[org.bitcoins.core.number.UInt64] = _root_.scala.Seq.empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[AliasMap] {
    private[this] def aliasesSerializedSize = {
      if (__aliasesSerializedSizeField == 0) __aliasesSerializedSizeField = {
        var __s: _root_.scala.Int = 0
        aliases.foreach(__i => __s += _root_.com.google.protobuf.CodedOutputStream.computeUInt64SizeNoTag(lnrpc.AliasMap._typemapper_aliases.toBase(__i)))
        __s
      }
      __aliasesSerializedSizeField
    }
    @transient private[this] var __aliasesSerializedSizeField: _root_.scala.Int = 0
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = lnrpc.AliasMap._typemapper_baseScid.toBase(baseScid)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
        }
      };
      if (aliases.nonEmpty) {
        val __localsize = aliasesSerializedSize
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__localsize) + __localsize
      }
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      {
        val __v = lnrpc.AliasMap._typemapper_baseScid.toBase(baseScid)
        if (__v != 0L) {
          _output__.writeUInt64(1, __v)
        }
      };
      if (aliases.nonEmpty) {
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(aliasesSerializedSize)
        aliases.foreach((_output__.writeUInt64NoTag _).compose(lnrpc.AliasMap._typemapper_aliases.toBase))
      };
      unknownFields.writeTo(_output__)
    }
    def withBaseScid(__v: org.bitcoins.core.number.UInt64): AliasMap = copy(baseScid = __v)
    def clearAliases = copy(aliases = _root_.scala.Seq.empty)
    def addAliases(__vs: org.bitcoins.core.number.UInt64 *): AliasMap = addAllAliases(__vs)
    def addAllAliases(__vs: Iterable[org.bitcoins.core.number.UInt64]): AliasMap = copy(aliases = aliases ++ __vs)
    def withAliases(__v: _root_.scala.Seq[org.bitcoins.core.number.UInt64]): AliasMap = copy(aliases = __v)
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 1 => {
          val __t = lnrpc.AliasMap._typemapper_baseScid.toBase(baseScid)
          if (__t != 0L) __t else null
        }
        case 2 => aliases.iterator.map(lnrpc.AliasMap._typemapper_aliases.toBase(_)).toSeq
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 1 => _root_.scalapb.descriptors.PLong(lnrpc.AliasMap._typemapper_baseScid.toBase(baseScid))
        case 2 => _root_.scalapb.descriptors.PRepeated(aliases.iterator.map(__e => _root_.scalapb.descriptors.PLong(lnrpc.AliasMap._typemapper_aliases.toBase(__e))).toVector)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: lnrpc.AliasMap.type = lnrpc.AliasMap
    // @@protoc_insertion_point(GeneratedMessage[lnrpc.AliasMap])
}

object AliasMap extends scalapb.GeneratedMessageCompanion[lnrpc.AliasMap] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.AliasMap] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.AliasMap = {
    var __baseScid: _root_.scala.Long = 0L
    val __aliases: _root_.scala.collection.immutable.VectorBuilder[org.bitcoins.core.number.UInt64] = new _root_.scala.collection.immutable.VectorBuilder[org.bitcoins.core.number.UInt64]
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __baseScid = _input__.readUInt64()
        case 16 =>
          __aliases += lnrpc.AliasMap._typemapper_aliases.toCustom(_input__.readUInt64())
        case 18 => {
          val length = _input__.readRawVarint32()
          val oldLimit = _input__.pushLimit(length)
          while (_input__.getBytesUntilLimit > 0) {
            __aliases += lnrpc.AliasMap._typemapper_aliases.toCustom(_input__.readUInt64())
          }
          _input__.popLimit(oldLimit)
        }
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    lnrpc.AliasMap(
        baseScid = lnrpc.AliasMap._typemapper_baseScid.toCustom(__baseScid),
        aliases = __aliases.result(),
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.AliasMap] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      lnrpc.AliasMap(
        baseScid = lnrpc.AliasMap._typemapper_baseScid.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        aliases = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Seq[_root_.scala.Long]]).getOrElse(_root_.scala.Seq.empty).iterator.map(lnrpc.AliasMap._typemapper_aliases.toCustom(_)).toSeq
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(44)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(44)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = lnrpc.AliasMap(
    baseScid = lnrpc.AliasMap._typemapper_baseScid.toCustom(0L),
    aliases = _root_.scala.Seq.empty
  )
  implicit class AliasMapLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.AliasMap]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.AliasMap](_l) {
    def baseScid: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.baseScid)((c_, f_) => c_.copy(baseScid = f_))
    def aliases: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[org.bitcoins.core.number.UInt64]] = field(_.aliases)((c_, f_) => c_.copy(aliases = f_))
  }
  final val BASE_SCID_FIELD_NUMBER = 1
  final val ALIASES_FIELD_NUMBER = 2
  @transient
  private[lnrpc] val _typemapper_baseScid: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  @transient
  private[lnrpc] val _typemapper_aliases: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  def of(
    baseScid: org.bitcoins.core.number.UInt64,
    aliases: _root_.scala.Seq[org.bitcoins.core.number.UInt64]
  ): _root_.lnrpc.AliasMap = _root_.lnrpc.AliasMap(
    baseScid,
    aliases
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.AliasMap])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy