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

com.urbanairship.api.push.model.notification.wns.WNSTileData Maven / Gradle / Ivy

There is a newer version: 9.4.2
Show newest version
/*
 * Copyright (c) 2013-2016.  Urban Airship and Contributors
 */

package com.urbanairship.api.push.model.notification.wns;

import com.google.common.collect.ImmutableList;

public class WNSTileData {
    private final ImmutableList bindings;

    private WNSTileData(ImmutableList bindings)
    {
        this.bindings = bindings;
    }

    public int getBindingCount() {
        return bindings.size();
    }

    public WNSBinding getBinding(int i) {
        return bindings.get(i);
    }

    public ImmutableList getBindings() {
        return bindings;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        WNSTileData that = (WNSTileData)o;

        return !(bindings != null ? !bindings.equals(that.bindings) : that.bindings != null);
    }

    @Override
    public int hashCode() {
        return (bindings != null ? bindings.hashCode() : 0);
    }

    public static class Builder {

        private final ImmutableList.Builder bindingsBuilder = ImmutableList.builder();

        private Builder() { }

        public Builder addBinding(WNSBinding value) {
            bindingsBuilder.add(value);
            return this;
        }

        public Builder addAllBindings(Iterable values) {
            bindingsBuilder.addAll(values);
            return this;
        }

        public WNSTileData build() {
            return new WNSTileData(bindingsBuilder.build());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy