示例#1
0
        public override LabelTokenRecord Clone()
        {
            LabelTokenRecord labelTokenRecord = new LabelTokenRecord(IntId);

            labelTokenRecord.InUse = InUse();
            if (Created)
            {
                labelTokenRecord.SetCreated();
            }
            labelTokenRecord.NameId = NameId;
            labelTokenRecord.AddNameRecords(NameRecords);
            return(labelTokenRecord);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMarshalTokenRequest() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMarshalTokenRequest()
        {
            ByteBuf buffer = Unpooled.buffer();

            List <StorageCommand> commands = new List <StorageCommand>();
            LabelTokenRecord      before   = new LabelTokenRecord(0);
            LabelTokenRecord      after    = new LabelTokenRecord(0);

            after.InUse = true;
            after.SetCreated();
            after.NameId = 3232;
            commands.Add(new Command.LabelTokenCommand(before, after));
            ReplicatedContent message = new ReplicatedTokenRequest(TokenType.LABEL, "theLabel", ReplicatedTokenRequestSerializer.commandBytes(commands));

            AssertMarshalingEquality(buffer, message);
        }
示例#3
0
 public virtual void Create(LabelTokenRecord labelToken)
 {
     labelToken.SetCreated();
     Update(new LabelTokenRecord(labelToken.IntId), labelToken);
 }