public com.openwallet.core.protos.Protos.DeterministicKey buildPartial() { com.openwallet.core.protos.Protos.DeterministicKey result = new com.openwallet.core.protos.Protos.DeterministicKey(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.chainCode_ = chainCode_; if (((bitField0_ & 0x00000002) == 0x00000002)) { path_ = java.util.Collections.unmodifiableList(path_); bitField0_ = (bitField0_ & ~0x00000002); } result.path_ = path_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000002; } result.issuedSubkeys_ = issuedSubkeys_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000004; } result.lookaheadSize_ = lookaheadSize_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000008; } result.isFollowing_ = isFollowing_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
byte[] chainCode = key.getDeterministicKey().getChainCode().toByteArray();
public Builder clear() { super.clear(); type_ = com.openwallet.core.protos.Protos.Key.Type.ORIGINAL; bitField0_ = (bitField0_ & ~0x00000001); secretBytes_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); if (encryptedDataBuilder_ == null) { encryptedData_ = com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance(); } else { encryptedDataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); publicKey_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000008); label_ = ""; bitField0_ = (bitField0_ & ~0x00000010); if (deterministicKeyBuilder_ == null) { deterministicKey_ = com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance(); } else { deterministicKeyBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); return this; }
if (EXTERNAL_PATH_NUM.equals(detkey.getChildNumber())) { chain.externalKey = detkey; chain.issuedExternalKeys = key.getDeterministicKey().getIssuedSubkeys(); lookaheadSize = Math.max(lookaheadSize, key.getDeterministicKey().getLookaheadSize()); } else if (INTERNAL_PATH_NUM.equals(detkey.getChildNumber())) { chain.internalKey = detkey; chain.issuedInternalKeys = key.getDeterministicKey().getIssuedSubkeys();
size += 1 * getPathList().size(); .computeBoolSize(5, isFollowing_); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
public Builder mergeFrom(com.openwallet.core.protos.Protos.DeterministicKey other) { if (other == com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance()) return this; if (other.hasChainCode()) { setChainCode(other.getChainCode()); } if (!other.path_.isEmpty()) { if (path_.isEmpty()) { path_ = other.path_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensurePathIsMutable(); path_.addAll(other.path_); } onChanged(); } if (other.hasIssuedSubkeys()) { setIssuedSubkeys(other.getIssuedSubkeys()); } if (other.hasLookaheadSize()) { setLookaheadSize(other.getLookaheadSize()); } if (other.hasIsFollowing()) { setIsFollowing(other.getIsFollowing()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional .com.openwallet.core.protos.DeterministicKey deterministic_key = 6;</code> */ public Builder mergeDeterministicKey(com.openwallet.core.protos.Protos.DeterministicKey value) { if (deterministicKeyBuilder_ == null) { if (((bitField0_ & 0x00000020) == 0x00000020) && deterministicKey_ != com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance()) { deterministicKey_ = com.openwallet.core.protos.Protos.DeterministicKey.newBuilder(deterministicKey_).mergeFrom(value).buildPartial(); } else { deterministicKey_ = value; } onChanged(); } else { deterministicKeyBuilder_.mergeFrom(value); } bitField0_ |= 0x00000020; return this; } /**
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, chainCode_); } for (int i = 0; i < path_.size(); i++) { output.writeUInt32(2, path_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeUInt32(3, issuedSubkeys_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeUInt32(4, lookaheadSize_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBool(5, isFollowing_); } getUnknownFields().writeTo(output); }
/** * <code>optional .com.openwallet.core.protos.DeterministicKey deterministic_key = 6;</code> */ public Builder clearDeterministicKey() { if (deterministicKeyBuilder_ == null) { deterministicKey_ = com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance(); onChanged(); } else { deterministicKeyBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); return this; } /**
/** * <code>required bytes chain_code = 1;</code> * * <pre> * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and * should just treat it as a regular ORIGINAL type key. * </pre> */ public Builder clearChainCode() { bitField0_ = (bitField0_ & ~0x00000001); chainCode_ = getDefaultInstance().getChainCode(); onChanged(); return this; }
public com.openwallet.core.protos.Protos.DeterministicKey getDefaultInstanceForType() { return com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance(); }
private void initFields() { type_ = com.openwallet.core.protos.Protos.Key.Type.ORIGINAL; secretBytes_ = com.google.protobuf.ByteString.EMPTY; encryptedData_ = com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance(); publicKey_ = com.google.protobuf.ByteString.EMPTY; label_ = ""; deterministicKey_ = com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance(); } private byte memoizedIsInitialized = -1;
public static ImmutableList<ChildNumber> getKeyProtoPath(Protos.Key key) { ImmutableList.Builder<ChildNumber> pathBuilder = ImmutableList.builder(); for (int i : key.getDeterministicKey().getPathList()) { pathBuilder.add(new ChildNumber(i)); } return pathBuilder.build(); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasChainCode()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }