public interface

ReadableConfig

implements Config

 androidx.camera.core.impl.ReadableConfig

Subclasses:

CameraXConfig, PreviewConfig, ImageCaptureConfig, ImageInputConfig, CameraConfig, ImageAnalysisConfig, UseCaseConfig<T>, ImageOutputConfig, VideoCaptureConfig, UseCaseEventConfig, TargetConfig<T>, IoConfig, ThreadConfig, VideoCaptureConfig<T>, CaptureRequestOptions, Camera2ImplConfig

Gradle dependencies

compile group: 'androidx.camera', name: 'camera-core', version: '1.2.0-alpha01'

  • groupId: androidx.camera
  • artifactId: camera-core
  • version: 1.2.0-alpha01

Artifact androidx.camera:camera-core:1.2.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

Interface that can be extended to create APIs for reading specific options.

ReadableConfig objects are also Config objects, so can be passed to any method that expects a Config.

Summary

Methods
public booleancontainsOption(Config.Option<java.lang.Object> id)

public voidfindOptions(java.lang.String idSearchString, Config.OptionMatcher matcher)

public ConfiggetConfig()

Returns the underlying immutable Config object.

public Config.OptionPrioritygetOptionPriority(Config.Option<java.lang.Object> opt)

public java.util.Set<Config.OptionPriority>getPriorities(Config.Option<java.lang.Object> option)

public java.util.Set<Config.Option>listOptions()

public java.lang.ObjectretrieveOption(Config.Option<java.lang.Object> id)

public java.lang.ObjectretrieveOption(Config.Option<java.lang.Object> id, java.lang.Object valueIfMissing)

public java.lang.ObjectretrieveOptionWithPriority(Config.Option<java.lang.Object> id, Config.OptionPriority priority)

Methods

public Config getConfig()

Returns the underlying immutable Config object.

Returns:

The underlying Config object.

public boolean containsOption(Config.Option<java.lang.Object> id)

public java.lang.Object retrieveOption(Config.Option<java.lang.Object> id)

public java.lang.Object retrieveOption(Config.Option<java.lang.Object> id, java.lang.Object valueIfMissing)

public void findOptions(java.lang.String idSearchString, Config.OptionMatcher matcher)

public java.util.Set<Config.Option> listOptions()

public java.lang.Object retrieveOptionWithPriority(Config.Option<java.lang.Object> id, Config.OptionPriority priority)

public Config.OptionPriority getOptionPriority(Config.Option<java.lang.Object> opt)

public java.util.Set<Config.OptionPriority> getPriorities(Config.Option<java.lang.Object> option)

Source

/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed 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.
 */

package androidx.camera.core.impl;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;

import java.util.Set;

/**
 * Interface that can be extended to create APIs for reading specific options.
 *
 * <p>ReadableConfig objects are also {@link Config} objects, so can be passed to any method that
 * expects a {@link Config}.
 */
@RequiresApi(21) // TODO(b/200306659): Remove and replace with annotation on package-info.java
public interface ReadableConfig extends Config {

    /**
     * Returns the underlying immutable {@link Config} object.
     *
     * @return The underlying {@link Config} object.
     */
    @NonNull
    Config getConfig();

    @Override
    default boolean containsOption(@NonNull Option<?> id) {
        return getConfig().containsOption(id);
    }

    @Override
    @Nullable
    default <ValueT> ValueT retrieveOption(@NonNull Option<ValueT> id) {
        return getConfig().retrieveOption(id);
    }

    @Override
    @Nullable
    default <ValueT> ValueT retrieveOption(@NonNull Option<ValueT> id,
            @Nullable ValueT valueIfMissing) {
        return getConfig().retrieveOption(id, valueIfMissing);
    }

    @Override
    default void findOptions(@NonNull String idSearchString, @NonNull OptionMatcher matcher) {
        getConfig().findOptions(idSearchString, matcher);
    }

    @Override
    @NonNull
    default Set<Option<?>> listOptions() {
        return getConfig().listOptions();
    }

    @Override
    @Nullable
    default <ValueT> ValueT retrieveOptionWithPriority(@NonNull Option<ValueT> id,
            @NonNull OptionPriority priority) {
        return getConfig().retrieveOptionWithPriority(id, priority);
    }

    @Override
    @NonNull
    default OptionPriority getOptionPriority(@NonNull Option<?> opt) {
        return getConfig().getOptionPriority(opt);
    }

    @NonNull
    @Override
    default Set<OptionPriority> getPriorities(@NonNull Option<?> option) {
        return getConfig().getPriorities(option);
    }
}