Class DimensionsChecker
Object
DimensionsChecker
Utility class for checking and ensuring consistency of dimensions across channels and masks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheck(Channel channelToCheck, String channelToCheckName, Dimensions dimFromChannel) Checks a channel to make sure it's the same size as an existing channel.static voidChecks if a channel and a mask have the same dimensions.static voidcheck(Mask maskToCheck, String channelToCheckName, Dimensions dimensionsFromChannel) Checks a mask to make sure it's the same size as an existing channel.static ChannelcreateSameSize(ChannelProvider provider, String providerName, Channel channelSameSize) Creates a new channel from a provider, making sure it's the same size as an existing channel.static MaskcreateSameSize(MaskProvider provider, String providerName, Channel channelSameSize) Creates a new mask from a provider, making sure it's the same size as an existing channel.
-
Method Details
-
check
Checks if a channel and a mask have the same dimensions.- Parameters:
channel- theChannelto checkmask- theMaskto check against- Throws:
ProvisionFailedException- if the dimensions do not match
-
check
public static void check(Channel channelToCheck, String channelToCheckName, Dimensions dimFromChannel) throws ProvisionFailedException Checks a channel to make sure it's the same size as an existing channel.- Parameters:
channelToCheck- theChannelwhose size will be comparedchannelToCheckName- a user-meaningful string to identify the channelToCheck in error messagesdimFromChannel- theDimensionsit must equal from channel (identified as channel in error messages)- Throws:
ProvisionFailedException- if the dimensions do not match
-
check
public static void check(Mask maskToCheck, String channelToCheckName, Dimensions dimensionsFromChannel) throws ProvisionFailedException Checks a mask to make sure it's the same size as an existing channel.- Parameters:
maskToCheck- theMaskwhose size will be comparedchannelToCheckName- a user-meaningful string to identify the channelToCheck in error messagesdimensionsFromChannel- theDimensionsit must equal from channel (identified as channel in error messages)- Throws:
ProvisionFailedException- if the dimensions do not match
-
createSameSize
public static Channel createSameSize(ChannelProvider provider, String providerName, Channel channelSameSize) throws ProvisionFailedException Creates a new channel from a provider, making sure it's the same size as an existing channel.- Parameters:
provider- theChannelProviderto create the channelproviderName- a user-meaningful string to identify the provider in error messageschannelSameSize- theChannelwhich it must be the same size as (referred to in error messages as "channel")- Returns:
- the newly created
Channel - Throws:
ProvisionFailedException- if the dimensions do not match or channel creation fails
-
createSameSize
public static Mask createSameSize(MaskProvider provider, String providerName, Channel channelSameSize) throws ProvisionFailedException Creates a new mask from a provider, making sure it's the same size as an existing channel.- Parameters:
provider- theMaskProviderto create the maskproviderName- a user-meaningful string to identify the provider in error messageschannelSameSize- theChannelwhich it must be the same size as (referred to in error messages as "channel")- Returns:
- the newly created
Mask - Throws:
ProvisionFailedException- if the dimensions do not match or mask creation fails
-