1 /* 2 * Copyright 2020 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.bremersee.data.minio; 18 19 import javax.validation.constraints.NotEmpty; 20 import org.springframework.validation.annotation.Validated; 21 22 /** 23 * The minio object id interface. 24 * 25 * @author Christian Bremer 26 */ 27 @Validated 28 public interface MinioObjectId { 29 30 /** 31 * From object name. 32 * 33 * @param name the name 34 * @return the minio object id 35 */ 36 static MinioObjectId from(@NotEmpty String name) { 37 return from(name, null); 38 } 39 40 /** 41 * From object name and version ID. 42 * 43 * @param name the name 44 * @param version the version 45 * @return the minio object id 46 */ 47 static MinioObjectId from(@NotEmpty String name, String version) { 48 return new DefaultMinioObjectId(name, version); 49 } 50 51 /** 52 * Gets name. 53 * 54 * @return the name 55 */ 56 @NotEmpty 57 String getName(); 58 59 /** 60 * Gets version id. 61 * 62 * @return the version id 63 */ 64 String getVersionId(); 65 66 }