Skip to main content
Post Closed as "Opinion-based" by gnat, Dan Wilson, Greg Burghardt
Question Protected by gnat
added 37 characters in body
Source Link

iI am not a native english speaker so I have the following question related to naming I have a class that has generic filter method of type:

filter(Predicate predicate)

In the same class I have some more concrete filter methods of type:

filter(EventName eventName) or filter(Datafield datafield)

Is it acceptable to use the prefix "with" for a filtering method. I have mostly encountered it in builder patterns not in a filter type of chaining. Is it a nonsense from the point of the language - english also from the point of naming conventions?

Then the code will look like:

messages.withEventName(eventName).withDatafield(datafield).first()

i have the following question I have a class that has generic filter method of type:

filter(Predicate predicate)

In the same class I have some more concrete filter methods of type:

filter(EventName eventName) or filter(Datafield datafield)

Is it acceptable to use the prefix "with" for a filtering method. I have mostly encountered it in builder patterns not in a filter type of chaining.

Then the code will look like:

messages.withEventName(eventName).withDatafield(datafield).first()

I am not a native english speaker so I have the following question related to naming I have a class that has generic filter method of type:

filter(Predicate predicate)

In the same class I have some more concrete filter methods of type:

filter(EventName eventName) or filter(Datafield datafield)

Is it acceptable to use the prefix "with" for a filtering method. I have mostly encountered it in builder patterns not in a filter type of chaining. Is it a nonsense from the point of the language - english also from the point of naming conventions?

Then the code will look like:

messages.withEventName(eventName).withDatafield(datafield).first()
Source Link

Is usage of "with" prefix acceptable for filter methods that are specific(not generic)

i have the following question I have a class that has generic filter method of type:

filter(Predicate predicate)

In the same class I have some more concrete filter methods of type:

filter(EventName eventName) or filter(Datafield datafield)

Is it acceptable to use the prefix "with" for a filtering method. I have mostly encountered it in builder patterns not in a filter type of chaining.

Then the code will look like:

messages.withEventName(eventName).withDatafield(datafield).first()