Constructs a new oneof instance.
Parameters:
name |
string |
Oneof name |
fieldNames |
Array.<string> | Object.<string, *> |
optional
Field names |
options |
Object.<string, *> |
optional
Declared options |
comment |
string |
optional
Comment associated with this field |
Extends
Members
-
Comment for this field.
-
Fields that belong to this oneof as an array for iteration.
-
Defining file name.
-
Full name including leading dot.
-
Determines whether this field corresponds to a synthetic oneof created for
a proto3 optional field. No behavioral logic should depend on this, but it
can be relevant for reflection. -
Unique name within its namespace.
-
Field names that belong to this oneof.
-
Options.
-
Parent namespace.
-
Parsed Options.
-
Whether already resolved or not.
-
Reference to the root namespace.
Methods
-
Adds a field to this oneof and removes it from its current parent, if any.
Parameters:
fieldField Field to add
Returns:
OneOf this -
Gets an option value.
Parameters:
namestring Option name
Returns:
* Option value or undefinedif not set -
Called when this object is added to a parent.
Parameters:
parentReflectionObject Parent added to
Returns:
undefined -
Called when this object is removed from a parent.
Parameters:
parentReflectionObject Parent removed from
Returns:
undefined -
Removes a field from this oneof and puts it back to the oneof's parent.
Parameters:
fieldField Field to remove
Returns:
OneOf this -
inherited resolve(){ ReflectionObject }
-
Resolves this objects type references.
Returns:
ReflectionObject this -
inherited setOption(name, value, ifNotSet){ ReflectionObject }
-
Sets an option.
Parameters:
namestring Option name
value* Option value
ifNotSetboolean | undefined optional Sets the option only if it isn't currently set
Returns:
ReflectionObject this -
inherited setOptions(options, ifNotSet){ ReflectionObject }
-
Sets multiple options.
Parameters:
optionsObject.<string, *> Options to set
ifNotSetboolean optional Sets an option only if it isn't currently set
Returns:
ReflectionObject this -
inherited setParsedOption(name, value, propName){ ReflectionObject }
-
Sets a parsed option.
Parameters:
namestring parsed Option name
value* Option value
propNamestring dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value
Returns:
ReflectionObject this -
Converts this oneof to a oneof descriptor.
Parameters:
toJSONOptionsIToJSONOptions optional JSON conversion options
Returns:
IOneOf Oneof descriptor -
Converts this instance to its string representation.
Returns:
string Class name[, space, full name] -
OneOf.d(fieldNames){ OneOfDecorator }
-
OneOf decorator (TypeScript).
Parameters:
fieldNamesstring repeatable Field names
Deprecated:
Returns:
OneOfDecorator Decorator function -
Constructs a oneof from a oneof descriptor.
Parameters:
namestring Oneof name
jsonIOneOf Oneof descriptor
Throws:
TypeError If arguments are invalid
Returns:
OneOf Created oneof