Class DimensionsChecker
Object
DimensionsChecker
Utility class for checking and ensuring consistency of dimensions across channels and masks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
check
(Channel channelToCheck, String channelToCheckName, Dimensions dimFromChannel) Checks a channel to make sure it's the same size as an existing channel.static void
Checks if a channel and a mask have the same dimensions.static void
check
(Mask maskToCheck, String channelToCheckName, Dimensions dimensionsFromChannel) Checks a mask to make sure it's the same size as an existing channel.static Channel
createSameSize
(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 Mask
createSameSize
(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
- theChannel
to checkmask
- theMask
to 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
- theChannel
whose size will be comparedchannelToCheckName
- a user-meaningful string to identify the channelToCheck in error messagesdimFromChannel
- theDimensions
it 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
- theMask
whose size will be comparedchannelToCheckName
- a user-meaningful string to identify the channelToCheck in error messagesdimensionsFromChannel
- theDimensions
it 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
- theChannelProvider
to create the channelproviderName
- a user-meaningful string to identify the provider in error messageschannelSameSize
- theChannel
which 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
- theMaskProvider
to create the maskproviderName
- a user-meaningful string to identify the provider in error messageschannelSameSize
- theChannel
which 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
-