| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // This file is autogenerated by: |
| // mojo/public/tools/bindings/mojom_bindings_generator.py |
| // For: |
| // mojom/vanadium/discovery.mojom |
| // |
| |
| package io.v.mojo.discovery; |
| |
| public final class Update extends org.chromium.mojo.bindings.Struct { |
| |
| private static final int STRUCT_SIZE = 24; |
| private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(24, 0)}; |
| private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0]; |
| |
| public Service service; |
| public int updateType; |
| |
| private Update(int version) { |
| super(STRUCT_SIZE, version); |
| } |
| |
| public Update() { |
| this(0); |
| } |
| |
| public static Update deserialize(org.chromium.mojo.bindings.Message message) { |
| return decode(new org.chromium.mojo.bindings.Decoder(message)); |
| } |
| |
| @SuppressWarnings("unchecked") |
| public static Update decode(org.chromium.mojo.bindings.Decoder decoder0) { |
| if (decoder0 == null) { |
| return null; |
| } |
| org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY); |
| Update result = new Update(mainDataHeader.elementsOrVersion); |
| if (mainDataHeader.elementsOrVersion >= 0) { |
| org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(8, false); |
| result.service = Service.decode(decoder1); |
| } |
| if (mainDataHeader.elementsOrVersion >= 0) { |
| result.updateType = decoder0.readInt(16); |
| } |
| return result; |
| } |
| |
| @SuppressWarnings("unchecked") |
| @Override |
| protected final void encode(org.chromium.mojo.bindings.Encoder encoder) { |
| org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO); |
| encoder0.encode(service, 8, false); |
| encoder0.encode(updateType, 16); |
| } |
| |
| /** |
| * @see Object#equals(Object) |
| */ |
| @Override |
| public boolean equals(Object object) { |
| if (object == this) |
| return true; |
| if (object == null) |
| return false; |
| if (getClass() != object.getClass()) |
| return false; |
| Update other = (Update) object; |
| if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.service, other.service)) |
| return false; |
| if (this.updateType != other.updateType) |
| return false; |
| return true; |
| } |
| |
| /** |
| * @see Object#hashCode() |
| */ |
| @Override |
| public int hashCode() { |
| final int prime = 31; |
| int result = prime + getClass().hashCode(); |
| result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(service); |
| result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(updateType); |
| return result; |
| } |
| } |
| |