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

com.backblaze.b2.client.structures.B2GetFileInfoByNameRequest Maven / Gradle / Ivy

Go to download

The core logic for B2 SDK for Java. Does not include any implementations of B2WebApiClient.

There is a newer version: 6.3.0
Show newest version
/*
 * Copyright 2017, Backblaze Inc. All Rights Reserved.
 * License https://www.backblaze.com/using_b2_code.html
 */
package com.backblaze.b2.client.structures;

import com.backblaze.b2.util.B2Preconditions;

import java.util.Objects;

public class B2GetFileInfoByNameRequest {
    private final String bucketName;
    private final String fileName;

    public B2GetFileInfoByNameRequest(String bucketName,
                                      String fileName) {
        B2Preconditions.checkArgument(bucketName != null);
        B2Preconditions.checkArgument(fileName != null);
        this.bucketName = bucketName;
        this.fileName = fileName;
    }

    public String getBucketName() {
        return bucketName;
    }

    public String getFileName() {
        return fileName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        B2GetFileInfoByNameRequest that = (B2GetFileInfoByNameRequest) o;
        return Objects.equals(bucketName, that.bucketName) &&
                Objects.equals(fileName, that.fileName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bucketName, fileName);
    }

    public static Builder builder(String bucketName,
                                  String fileName) {
        return new Builder(bucketName, fileName);
    }

    public static class Builder {
        private final String bucketName;
        private final String fileName;

        private Builder(String bucketName,
                        String fileName) {
            this.bucketName = bucketName;
            this.fileName = fileName;
        }

        public B2GetFileInfoByNameRequest build() {
            return new B2GetFileInfoByNameRequest(
                    bucketName,
                    fileName);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy