View Javadoc
1   /*
2    * #%L
3    * wcm.io
4    * %%
5    * Copyright (C) 2021 wcm.io
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package io.wcm.handler.media;
21  
22  import org.jetbrains.annotations.NotNull;
23  import org.osgi.annotation.versioning.ProviderType;
24  
25  /**
26   * Describes an URI template returned for a given asset.
27   */
28  @ProviderType
29  public interface UriTemplate {
30  
31    /**
32     * @return URI template string containing placeholders like <code>{width}</code> or <code>{height}</code>.
33     */
34    @NotNull
35    String getUriTemplate();
36  
37    /**
38     * @return URI template type
39     */
40    @NotNull
41    UriTemplateType getType();
42  
43    /**
44     * @return Maximum width that can be requested for the given asset. Returns 0 if no maximum width is defined.
45     */
46    long getMaxWidth();
47  
48    /**
49     * @return Maximum height that can be requested for the given asset. Returns 0 if no maximum height is defined.
50     */
51    long getMaxHeight();
52  
53  }