blob: c47ddb2f9fbba201df59b1101c6ff19560afdafb [file]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/java.rs.
package org.apache.opendal;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
/**
* Capability defines the supported operations and their constraints for a storage Operator.
*
* <p>Size limit fields ({@code long}) are set to {@code -1L} when the operator does not define a limit.
*/
@Data
@Builder(toBuilder = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class Capability {
{% for f in fields %}
/**
* {{ f.doc }}
*/
public final {% if f.is_bool %}boolean{% else %}long{% endif %} {{ f.camel }};
{% endfor %}
/**
* Builder for {@link Capability}. Size limit fields default to {@code -1L}.
*/
public static class CapabilityBuilder {
{%- for f in fields %}
{%- if not f.is_bool %}
private long {{ f.camel }} = -1;
{%- endif %}
{%- endfor %}
}
/**
* Creates capabilities with the read version and timestamp flags set to false.
*
* @deprecated Use {@code Capability.builder()} instead.
*/
@Deprecated
public Capability(
boolean stat,
boolean statWithIfMatch,
boolean statWithIfNoneMatch,
boolean statWithIfVersionMatch,
boolean statWithIfVersionNotMatch,
boolean statWithIfModifiedSince,
boolean statWithIfUnmodifiedSince,
boolean statWithVersion,
boolean read,
boolean readWithIfMatch,
boolean readWithIfNoneMatch,
boolean readWithOverrideCacheControl,
boolean readWithOverrideContentDisposition,
boolean readWithOverrideContentType,
boolean write,
boolean writeCanMulti,
boolean writeCanAppend,
boolean writeWithContentType,
boolean writeWithContentDisposition,
boolean writeWithCacheControl,
boolean writeWithIfMatch,
boolean writeWithIfNoneMatch,
boolean writeWithIfNotExists,
boolean writeWithUserMetadata,
long writeMultiMaxSize,
long writeMultiMinSize,
boolean createDir,
boolean delete,
boolean copy,
boolean rename,
boolean list,
boolean listWithLimit,
boolean listWithStartAfter,
boolean listWithRecursive,
boolean listWithVersions,
boolean listWithDeleted,
boolean presign,
boolean presignRead,
boolean presignStat,
boolean presignWrite,
boolean shared) {
this(
stat,
statWithIfMatch,
statWithIfNoneMatch,
statWithIfVersionMatch,
statWithIfVersionNotMatch,
statWithIfModifiedSince,
statWithIfUnmodifiedSince,
statWithVersion,
read,
readWithIfMatch,
readWithIfNoneMatch,
readWithOverrideCacheControl,
readWithOverrideContentDisposition,
readWithOverrideContentType,
write,
writeCanMulti,
writeCanAppend,
writeWithContentType,
writeWithContentDisposition,
writeWithCacheControl,
writeWithIfMatch,
writeWithIfNoneMatch,
writeWithIfNotExists,
writeWithUserMetadata,
writeMultiMaxSize,
writeMultiMinSize,
createDir,
delete,
copy,
rename,
list,
listWithLimit,
listWithStartAfter,
listWithRecursive,
listWithVersions,
listWithDeleted,
presign,
presignRead,
presignStat,
presignWrite,
shared,
false,
false,
false,
false,
false);
}
/**
* Creates capabilities with the legacy 46-parameter signature.
*
* @deprecated Use {@code Capability.builder()} instead.
*/
@Deprecated
public Capability(
boolean stat,
boolean statWithIfMatch,
boolean statWithIfNoneMatch,
boolean statWithIfVersionMatch,
boolean statWithIfVersionNotMatch,
boolean statWithIfModifiedSince,
boolean statWithIfUnmodifiedSince,
boolean statWithVersion,
boolean read,
boolean readWithIfMatch,
boolean readWithIfNoneMatch,
boolean readWithOverrideCacheControl,
boolean readWithOverrideContentDisposition,
boolean readWithOverrideContentType,
boolean write,
boolean writeCanMulti,
boolean writeCanAppend,
boolean writeWithContentType,
boolean writeWithContentDisposition,
boolean writeWithCacheControl,
boolean writeWithIfMatch,
boolean writeWithIfNoneMatch,
boolean writeWithIfNotExists,
boolean writeWithUserMetadata,
long writeMultiMaxSize,
long writeMultiMinSize,
boolean createDir,
boolean delete,
boolean copy,
boolean rename,
boolean list,
boolean listWithLimit,
boolean listWithStartAfter,
boolean listWithRecursive,
boolean listWithVersions,
boolean listWithDeleted,
boolean presign,
boolean presignRead,
boolean presignStat,
boolean presignWrite,
boolean shared,
boolean readWithVersion,
boolean readWithIfVersionMatch,
boolean readWithIfVersionNotMatch,
boolean readWithIfModifiedSince,
boolean readWithIfUnmodifiedSince) {
{%- for f in fields %}
this.{{ f.camel }} = {% if f.in_legacy_46 %}{{ f.camel }}{% elif f.is_bool %}false{% else %}-1L{% endif %};
{%- endfor %}
}
}