target.apidocs.com.google.api.services.sheets.v4.model.CellData.html Maven / Gradle / Ivy
CellData (Google Sheets API v4-rev20230526-2.0.0)
com.google.api.services.sheets.v4.model
Class CellData
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.sheets.v4.model.CellData
-
public final class CellData
extends com.google.api.client.json.GenericJson
Data about a specific cell.
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the Google Sheets API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
CellData()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
CellData
clone()
DataSourceFormula
getDataSourceFormula()
Output only.
DataSourceTable
getDataSourceTable()
A data source table anchored at this cell.
DataValidationRule
getDataValidation()
A data validation rule on the cell, if any.
CellFormat
getEffectiveFormat()
The effective format being used by the cell.
ExtendedValue
getEffectiveValue()
The effective value of the cell.
String
getFormattedValue()
The formatted value of the cell.
String
getHyperlink()
A hyperlink this cell points to, if any.
String
getNote()
Any note on the cell.
PivotTable
getPivotTable()
A pivot table anchored at this cell.
List<TextFormatRun>
getTextFormatRuns()
Runs of rich text applied to subsections of the cell.
CellFormat
getUserEnteredFormat()
The format the user entered for the cell.
ExtendedValue
getUserEnteredValue()
The value the user entered in the cell.
CellData
set(String fieldName,
Object value)
CellData
setDataSourceFormula(DataSourceFormula dataSourceFormula)
Output only.
CellData
setDataSourceTable(DataSourceTable dataSourceTable)
A data source table anchored at this cell.
CellData
setDataValidation(DataValidationRule dataValidation)
A data validation rule on the cell, if any.
CellData
setEffectiveFormat(CellFormat effectiveFormat)
The effective format being used by the cell.
CellData
setEffectiveValue(ExtendedValue effectiveValue)
The effective value of the cell.
CellData
setFormattedValue(String formattedValue)
The formatted value of the cell.
CellData
setHyperlink(String hyperlink)
A hyperlink this cell points to, if any.
CellData
setNote(String note)
Any note on the cell.
CellData
setPivotTable(PivotTable pivotTable)
A pivot table anchored at this cell.
CellData
setTextFormatRuns(List<TextFormatRun> textFormatRuns)
Runs of rich text applied to subsections of the cell.
CellData
setUserEnteredFormat(CellFormat userEnteredFormat)
The format the user entered for the cell.
CellData
setUserEnteredValue(ExtendedValue userEnteredValue)
The value the user entered in the cell.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getDataSourceFormula
public DataSourceFormula getDataSourceFormula()
Output only. Information about a data source formula on the cell. The field is set if
user_entered_value is a formula referencing some DATA_SOURCE sheet, e.g.
`=SUM(DataSheet!Column)`.
- Returns:
- value or
null
for none
-
setDataSourceFormula
public CellData setDataSourceFormula(DataSourceFormula dataSourceFormula)
Output only. Information about a data source formula on the cell. The field is set if
user_entered_value is a formula referencing some DATA_SOURCE sheet, e.g.
`=SUM(DataSheet!Column)`.
- Parameters:
dataSourceFormula
- dataSourceFormula or null
for none
-
getDataSourceTable
public DataSourceTable getDataSourceTable()
A data source table anchored at this cell. The size of data source table itself is computed
dynamically based on its configuration. Only the first cell of the data source table contains
the data source table definition. The other cells will contain the display values of the data
source table result in their effective_value fields.
- Returns:
- value or
null
for none
-
setDataSourceTable
public CellData setDataSourceTable(DataSourceTable dataSourceTable)
A data source table anchored at this cell. The size of data source table itself is computed
dynamically based on its configuration. Only the first cell of the data source table contains
the data source table definition. The other cells will contain the display values of the data
source table result in their effective_value fields.
- Parameters:
dataSourceTable
- dataSourceTable or null
for none
-
getDataValidation
public DataValidationRule getDataValidation()
A data validation rule on the cell, if any. When writing, the new data validation rule will
overwrite any prior rule.
- Returns:
- value or
null
for none
-
setDataValidation
public CellData setDataValidation(DataValidationRule dataValidation)
A data validation rule on the cell, if any. When writing, the new data validation rule will
overwrite any prior rule.
- Parameters:
dataValidation
- dataValidation or null
for none
-
getEffectiveFormat
public CellFormat getEffectiveFormat()
The effective format being used by the cell. This includes the results of applying any
conditional formatting and, if the cell contains a formula, the computed number format. If the
effective format is the default format, effective format will not be written. This field is
read-only.
- Returns:
- value or
null
for none
-
setEffectiveFormat
public CellData setEffectiveFormat(CellFormat effectiveFormat)
The effective format being used by the cell. This includes the results of applying any
conditional formatting and, if the cell contains a formula, the computed number format. If the
effective format is the default format, effective format will not be written. This field is
read-only.
- Parameters:
effectiveFormat
- effectiveFormat or null
for none
-
getEffectiveValue
public ExtendedValue getEffectiveValue()
The effective value of the cell. For cells with formulas, this is the calculated value. For
cells with literals, this is the same as the user_entered_value. This field is read-only.
- Returns:
- value or
null
for none
-
setEffectiveValue
public CellData setEffectiveValue(ExtendedValue effectiveValue)
The effective value of the cell. For cells with formulas, this is the calculated value. For
cells with literals, this is the same as the user_entered_value. This field is read-only.
- Parameters:
effectiveValue
- effectiveValue or null
for none
-
getFormattedValue
public String getFormattedValue()
The formatted value of the cell. This is the value as it's shown to the user. This field is
read-only.
- Returns:
- value or
null
for none
-
setFormattedValue
public CellData setFormattedValue(String formattedValue)
The formatted value of the cell. This is the value as it's shown to the user. This field is
read-only.
- Parameters:
formattedValue
- formattedValue or null
for none
-
getHyperlink
public String getHyperlink()
A hyperlink this cell points to, if any. If the cell contains multiple hyperlinks, this field
will be empty. This field is read-only. To set it, use a `=HYPERLINK` formula in the
userEnteredValue.formulaValue field. A cell-level link can also be set from the
userEnteredFormat.textFormat field. Alternatively, set a hyperlink in the
textFormatRun.format.link field that spans the entire cell.
- Returns:
- value or
null
for none
-
setHyperlink
public CellData setHyperlink(String hyperlink)
A hyperlink this cell points to, if any. If the cell contains multiple hyperlinks, this field
will be empty. This field is read-only. To set it, use a `=HYPERLINK` formula in the
userEnteredValue.formulaValue field. A cell-level link can also be set from the
userEnteredFormat.textFormat field. Alternatively, set a hyperlink in the
textFormatRun.format.link field that spans the entire cell.
- Parameters:
hyperlink
- hyperlink or null
for none
-
getNote
public String getNote()
Any note on the cell.
- Returns:
- value or
null
for none
-
setNote
public CellData setNote(String note)
Any note on the cell.
- Parameters:
note
- note or null
for none
-
getPivotTable
public PivotTable getPivotTable()
A pivot table anchored at this cell. The size of pivot table itself is computed dynamically
based on its data, grouping, filters, values, etc. Only the top-left cell of the pivot table
contains the pivot table definition. The other cells will contain the calculated values of the
results of the pivot in their effective_value fields.
- Returns:
- value or
null
for none
-
setPivotTable
public CellData setPivotTable(PivotTable pivotTable)
A pivot table anchored at this cell. The size of pivot table itself is computed dynamically
based on its data, grouping, filters, values, etc. Only the top-left cell of the pivot table
contains the pivot table definition. The other cells will contain the calculated values of the
results of the pivot in their effective_value fields.
- Parameters:
pivotTable
- pivotTable or null
for none
-
getTextFormatRuns
public List<TextFormatRun> getTextFormatRuns()
Runs of rich text applied to subsections of the cell. Runs are only valid on user entered
strings, not formulas, bools, or numbers. Properties of a run start at a specific index in the
text and continue until the next run. Runs will inherit the properties of the cell unless
explicitly changed. When writing, the new runs will overwrite any prior runs. When writing a
new user_entered_value, previous runs are erased.
- Returns:
- value or
null
for none
-
setTextFormatRuns
public CellData setTextFormatRuns(List<TextFormatRun> textFormatRuns)
Runs of rich text applied to subsections of the cell. Runs are only valid on user entered
strings, not formulas, bools, or numbers. Properties of a run start at a specific index in the
text and continue until the next run. Runs will inherit the properties of the cell unless
explicitly changed. When writing, the new runs will overwrite any prior runs. When writing a
new user_entered_value, previous runs are erased.
- Parameters:
textFormatRuns
- textFormatRuns or null
for none
-
getUserEnteredFormat
public CellFormat getUserEnteredFormat()
The format the user entered for the cell. When writing, the new format will be merged with the
existing format.
- Returns:
- value or
null
for none
-
setUserEnteredFormat
public CellData setUserEnteredFormat(CellFormat userEnteredFormat)
The format the user entered for the cell. When writing, the new format will be merged with the
existing format.
- Parameters:
userEnteredFormat
- userEnteredFormat or null
for none
-
getUserEnteredValue
public ExtendedValue getUserEnteredValue()
The value the user entered in the cell. e.g., `1234`, `'Hello'`, or `=NOW()` Note: Dates, Times
and DateTimes are represented as doubles in serial number format.
- Returns:
- value or
null
for none
-
setUserEnteredValue
public CellData setUserEnteredValue(ExtendedValue userEnteredValue)
The value the user entered in the cell. e.g., `1234`, `'Hello'`, or `=NOW()` Note: Dates, Times
and DateTimes are represented as doubles in serial number format.
- Parameters:
userEnteredValue
- userEnteredValue or null
for none
-
set
public CellData set(String fieldName,
Object value)
- Overrides:
set
in class com.google.api.client.json.GenericJson
-
clone
public CellData clone()
- Overrides:
clone
in class com.google.api.client.json.GenericJson
Copyright © 2011–2023 Google. All rights reserved.