Container | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Methods | Inherited Methods | [Expand All]
public class

# Container

extends Object

java.lang.Object
↳ | com.google.android.gms.tagmanager.Container

## Class Overview

An object that provides access to container values. Container objects must be created via one of the `TagManager` `loadContainer` calls. Once a container is created, it can be queried for key values which may depend on rules established for the container.

## Summary

Nested Classes
interface | Container.FunctionCallMacroCallback | Callback that is provided by the application to calculate the value of a custom macro.
interface | Container.FunctionCallTagCallback | Callback that is provided by the application to execute a custom tag.

Public Methods
boolean | getBoolean(String key) Returns a boolean representing the configuration value for the given key.
String | getContainerId() Returns the container id.
double | getDouble(String key) Returns a double representing the configuration value for the given key.
long | getLastRefreshTime() Returns the last time (in milliseconds since midnight, January 1, 1970 UTC) that this container was refreshed from the network.
long | getLong(String key) Returns a long representing the configuration value for the given key.
String | getString(String key) Returns a string representing the configuration value for the given key.
boolean | isDefault() Returns whether this is a default container, or one refreshed from the server.
void | registerFunctionCallMacroCallback(String customMacroName, Container.FunctionCallMacroCallback customMacroCallback) Registers the given macro callback to handle a given function call macro.
void | registerFunctionCallTagCallback(String customTagName, Container.FunctionCallTagCallback customTagCallback) Registers the tag callback to handle a given function call tag.
void | unregisterFunctionCallMacroCallback(String customMacroName) Unregisters any macro callback for the given macro.
void | unregisterFunctionCallTagCallback(String customTagName) Unregisters any tag callback for the given tag.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Methods

#### public boolean getBoolean (String key)

Returns a boolean representing the configuration value for the given key. If the container has no value for this key, false will be returned.

#### public String getContainerId ()

Returns the container id.

#### public double getDouble (String key)

Returns a double representing the configuration value for the given key. If the container has no value for this key, 0 will be returned.

#### public long getLastRefreshTime ()

Returns the last time (in milliseconds since midnight, January 1, 1970 UTC) that this container was refreshed from the network.

#### public long getLong (String key)

Returns a long representing the configuration value for the given key. If the container has no value for this key, 0 will be returned.

#### public String getString (String key)

Returns a string representing the configuration value for the given key. If the container has no value for this key, an empty string will be returned.

#### public boolean isDefault ()

Returns whether this is a default container, or one refreshed from the server.

#### public void registerFunctionCallMacroCallback (String customMacroName, Container.FunctionCallMacroCallback customMacroCallback)

Registers the given macro callback to handle a given function call macro.

##### Parameters

customMacroName | the name of the macro which is being registered
customMacroCallback | the callback to register

#### public void registerFunctionCallTagCallback (String customTagName, Container.FunctionCallTagCallback customTagCallback)

Registers the tag callback to handle a given function call tag.

##### Parameters

customTagName | the name of the tag which is being registered
customTagCallback | the callback to register

#### public void unregisterFunctionCallMacroCallback (String customMacroName)

Unregisters any macro callback for the given macro.

##### Parameters

customMacroName | the name of the macro which is being unregistered

#### public void unregisterFunctionCallTagCallback (String customTagName)

Unregisters any tag callback for the given tag.

##### Parameters

customTagName | the name of the tag which is being unregistered