<commit_before>package org.csanchez.aws.glacier.domain;

import static org.apache.commons.io.FileUtils.byteCountToDisplaySize;

import org.csanchez.aws.glacier.utils.Check;

import com.amazonaws.services.glacier.model.DescribeVaultOutput;
import com.google.common.base.Function;

public final class Vault {

    public final String name;
    public final Long numberOfArchives;
    public final Long sizeInBytes;

    private final String arn;

    public Vault( String arn, String name, Long numberOfArchives, Long sizeInBytes ) {
        this.arn = Check.notBlank( arn );
        this.name = Check.notBlank( name );
        this.numberOfArchives = numberOfArchives;
        this.sizeInBytes = sizeInBytes;
    }

    public static Vault from( DescribeVaultOutput response ) {
        Check.notNull( response );
        return new Vault( response.getVaultARN(), response.getVaultName(), response.getNumberOfArchives(), response.getSizeInBytes() );
    }
    
    @Override
    public String toString() {
        return "Vault[name=" + name + ", numberOfArchives=" + numberOfArchives + ", size=" + byteCountToDisplaySize( sizeInBytes ) + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((arn == null) ? 0 : arn.hashCode());
        return result;
    }

    @Override
    public boolean equals( Object obj ) {
        if ( this == obj ) return true;
        if ( obj == null ) return false;
        if ( getClass() != obj.getClass() ) return false;
        Vault other = (Vault) obj;
        if ( arn == null ) {
            if ( other.arn != null ) return false;
        } else if ( !arn.equals( other.arn ) ) return false;
        return true;
    }<commit_msg>Removing static factory for DescribeVaultOutput in Vault - it shouldn't be part of this domain object<commit_after>package org.csanchez.aws.glacier.domain;

import static org.apache.commons.io.FileUtils.byteCountToDisplaySize;

import org.csanchez.aws.glacier.utils.Check;

public final class Vault {

    public final String name;
    public final Long numberOfArchives;
    public final Long sizeInBytes;

    private final String arn;

    public Vault( String arn, String name, Long numberOfArchives, Long sizeInBytes ) {
        this.arn = Check.notBlank( arn );
        this.name = Check.notBlank( name );
        this.numberOfArchives = numberOfArchives;
        this.sizeInBytes = sizeInBytes;
    }

    @Override
    public String toString() {
        return "Vault[name=" + name + ", numberOfArchives=" + numberOfArchives + ", size=" + byteCountToDisplaySize( sizeInBytes ) + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((arn == null) ? 0 : arn.hashCode());
        return result;
    }

    @Override
    public boolean equals( Object obj ) {
        if ( this == obj ) return true;
        if ( obj == null ) return false;
        if ( getClass() != obj.getClass() ) return false;
        Vault other = (Vault) obj;
        if ( arn == null ) {
            if ( other.arn != null ) return false;
        } else if ( !arn.equals( other.arn ) ) return false;
        return true;
    }
{'fraction_non_alphanumeric': 0.10673638880344509, 'fraction_numerical': 0.002460781298062135, 'mean_word_length': 2.601328903654485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6537814', 'n_tokens_mistral': 972, 'n_tokens_neox': 952, 'n_words': 273}