2018-03-05 08:28:13 +00:00
|
|
|
/**
|
|
|
|
* @flow
|
|
|
|
* AndroidChannelGroup representation wrapper
|
|
|
|
*/
|
|
|
|
|
|
|
|
type NativeAndroidChannelGroup = {|
|
|
|
|
groupId: string,
|
|
|
|
name: string,
|
|
|
|
|};
|
|
|
|
|
2018-03-09 11:09:20 +00:00
|
|
|
export default class AndroidChannelGroup {
|
2018-03-05 08:28:13 +00:00
|
|
|
_groupId: string;
|
|
|
|
_name: string;
|
|
|
|
|
2018-03-09 11:09:20 +00:00
|
|
|
constructor(groupId: string, name: string) {
|
|
|
|
this._groupId = groupId;
|
|
|
|
this._name = name;
|
|
|
|
}
|
|
|
|
|
2018-03-05 08:28:13 +00:00
|
|
|
get groupId(): string {
|
|
|
|
return this._groupId;
|
|
|
|
}
|
|
|
|
|
|
|
|
get name(): string {
|
|
|
|
return this._name;
|
|
|
|
}
|
|
|
|
|
|
|
|
build(): NativeAndroidChannelGroup {
|
|
|
|
if (!this._groupId) {
|
|
|
|
throw new Error(
|
|
|
|
'AndroidChannelGroup: Missing required `groupId` property'
|
|
|
|
);
|
|
|
|
} else if (!this._name) {
|
|
|
|
throw new Error('AndroidChannelGroup: Missing required `name` property');
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
groupId: this._groupId,
|
|
|
|
name: this._name,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|